Importing an existing passkey

Enrol a passkey your user already created under your own relying party as their Striga passkey, in one API call.

If your users already hold a passkey with you - created through the operating-system passkey sheet or a browser, under your own relying party - you can enrol that same passkey as their Striga passkey with one API call. The user does not create a second passkey and sees no extra prompt. This works for passkeys created before the user existed at Striga.

📘

This import takes an ordinary WebAuthn passkey and needs no App Attest and no Android Key Attestation. If instead your native app holds its own hardware key in the Secure Enclave or Android Keystore, see Device-bound passkeys (native apps). If you have no passkeys yet, use the standard enrolment on /user/passkey/register/start.

Before you start

  • Ask Striga to enable the import of existing passkeys for your application (sandbox and production are enabled separately). Until then the call answers 100010.
  • The passkey factor must be enabled for your application, and its relying party id and allowed origins configured in the portal.
  • The relying party id must be the one your passkeys were created for. A passkey is bound to its relying party id for life. If your passkeys were created for example.com, your application's relying party id at Striga must be exactly example.com, and the origins your site or app signs from must be on the allow-list. A passkey created for a different relying party id imports without error and then never verifies.
  • Only ES256 (P-256, COSE algorithm -7) passkeys can be imported. Passkeys from Apple and Google password managers are ES256; some Windows Hello and security-key credentials are not.

What you need to have stored

From the registration your own backend verified:

ValueWhere it comes from
Credential idPublicKeyCredential.rawId / id, base64url
Public keyAuthenticatorAttestationResponse.getPublicKey() (SPKI DER), base64url. If you stored the COSE key instead, convert it to SPKI DER or to the 65-byte uncompressed point
Signature counterthe counter from the latest assertion you verified (often 0 for synced passkeys)
TransportsAuthenticatorAttestationResponse.getTransports(), optional

The import

  1. Log the user in with /user/login/start + /user/login/complete. For a new user the order is: verify mobile, SMS login, then the import.
  2. Within 15 minutes of that login, make one call:
POST /user/passkey/import/complete
Authorization: <HMAC>

{
  "userId": "<uuid>",
  "platform": "WEBAUTHN",
  "passkey": {
    "credentialId": "kNU6hAiNBBV_Z0tmitASZw",
    "publicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...",
    "algorithm": -7,
    "displayName": "Pixel 9",
    "signCount": 0,
    "transports": ["internal", "hybrid"]
  }
}
{
  "credential": {
    "id": "37f80819-fe92-4652-a7e6-1c54da66ea2f",
    "credentialId": "kNU6hAiNBBV_Z0tmitASZw",
    "displayName": "Pixel 9",
    "name": "imported:webauthn:kNU6hAiN",
    "relyingPartyId": "example.com",
    "transports": ["internal", "hybrid"],
    "insertInstant": 1796106952880,
    "lastUseInstant": 1796106952880
  },
  "attestation": { "type": "NONE" },
  "multiFactorAuth": { "enabled": true, "primaryMethod": "passkey", "enrolledMethods": ["passkey"], "passkeyCount": 1 }
}
FieldConstraint
platformWEBAUTHN
passkey.credentialIdbase64url without padding, the id the authenticator issued (16 to 1023 bytes)
passkey.publicKeybase64url of the SPKI DER or of the 65-byte X9.63 uncompressed P-256 point
passkey.algorithm-7 (ES256) only
passkey.displayNameoptional, 1 to 64 characters, shown on the passkey list
passkey.signCountoptional integer, default 0: the last counter you saw
passkey.transportsoptional, any of internal, hybrid, usb, nfc, ble; default internal
preAttested, app, attestationleft out

What Striga checks, and what you vouch for

Striga checks that the import is enabled for your application, that the user logged in within the last 15 minutes, that the user is below the passkey limit, that the credential id is not already in use and that the key does not already back another imported passkey.

Nothing about the key itself can be verified, and no signature is taken at import. You vouch that the public key belongs to a passkey your user holds. If it does not, the import succeeds and the user's first passkey login or approval fails. The first proof of possession Striga sees is that first assertion.

Using the imported passkey

It is an ordinary passkey from then on. Run the usual ceremonies - /user/login/start + /user/login/complete, /wallets/passkey/approval/start + /wallets/transaction/confirm, trusted beneficiaries, standing orders - and pass the assertion your site or app gets from navigator.credentials.get() or the platform passkey API, exactly as for a passkey enrolled through /user/passkey/register/*.

  • The assertion's response.userHandle carries your user id, not Striga's. You may send it as it is; Striga ignores it for imported passkeys.
  • The signature counter must not go backwards. An assertion whose counter is below the imported signCount is refused; a counter that stays at 0, as synced passkeys report, is accepted.
  • The passkey counts towards the user's passkey limit, appears on /user/passkey/list and is removed or reset like any other. Removing it at Striga does not remove it from the user's device or from your own records.
  • Keep SMS or TOTP available as the fallback factor.

Business accounts

POST /business/passkey/import/complete follows the same contract keyed by businessId, after /business/login/start + /business/login/complete.

Errors

CodeMeaning
00002Request validation failed; message lists the fields (Invalid passkey.credentialId, passkey.algorithm must be -7, …).
30070No SCA login within the last 15 minutes (reason NO_SESSION or EXPIRED). Log the user in and retry.
100004Passkey limit reached. Remove one first.
100010The import of existing passkeys is not enabled for your application. Contact Striga.
999998The credentialId is already in use, or this key already backs an imported passkey.

Testing on sandbox

  • Use the sandbox SMS code 123456 for the login before the import.
  • Create the passkey on your own site or app first, under the relying party id configured for your sandbox application, then import it and run a passkey login to confirm the assertion verifies.