POST
/
webauthn
/
registration
/
initialize
Initialize WebAuthn registration
curl --request POST \
  --url https://{tenant_id}.hanko.io/webauthn/registration/initialize
{
  "publicKey": {
    "rp": {
      "name": "Hanko Authentication Service",
      "id": "localhost"
    },
    "user": {
      "id": "pPQT9rwJRD7gVncsnCDNyN",
      "name": "user@example.com",
      "displayName": "user@example.com"
    },
    "challenge": "7qmkJUXR0dOFnsW48evX3qKdCzlGjvvqAAvMDN+KTN0=",
    "pubKeyCredParams": [
      {
        "type": "public-key",
        "alg": -7
      }
    ],
    "timeout": 60000,
    "authenticatorSelection": {
      "authenticatorAttachment": "platform",
      "requireResidentKey": true,
      "residentKey": "preferred",
      "userVerification": "required"
    },
    "attestation": "none"
  }
}
Deprecated. Please use the Flow API instead. What’s the Flow API?.
Returns a JSON representation of CredentialCreationOptions for use with the Webauthn API’s navigator.credentials.create().
The Webauthn API uses binary data represented by ArrayBuffers for certain input/output values. The Hanko API returns these values as base64url-encoded, so they must be converted to ArrayBuffers when passed to the Webauthn API. Similarly, Webauthn API output must be converted to base64url-encoded values when passed to the Hanko API (e.g. using the webauthn-json library).

Authorizations

hanko
string
cookie
required

Response

200
application/json

Challenge

Options for credential creation with the WebAuthn API