Initiate WebAuthn Registration (beta)

POST /v1/auth/webauthn/registrations/begin

Initiate a WebAuthn Registration Request. This endpoint requires that a user already exists on Streambird. Pass the returned JSON object in public_key_credential_creation_options property into await create(options) as options if you are using webauthn-json or to navigator.credentials.create(options).

HTTP Request

POST /v1/auth/webauthn/registrations/begin

Returns

A successful response returns a public_key_credential_creation_options property and user_id property.

application/json

Body

  • domain string Required

    Required Domain of the app that will be using WebAuthn to provide user sign in.

    Minimum length is 1.

  • user_id string Required

    Required User ID of the user to attach this WebAuthn registration to.

    Minimum length is 1.

  • Optional The intended authenticator type for the WebAuthn device used. cross-platform is recommended for portable WebAuthn device like YubiKey and platform if you want to enable log in via platform specific methods such as FaceID or TouchID. Possible values: platform, cross-platform. Defaults to platform.

    Minimum length is 1.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • Hide public_key_credential_creation_options attribute Show public_key_credential_creation_options attribute object
      • publicKey object Required
        Hide publicKey attributes Show publicKey attributes object
        • challenge string Required

          Minimum length is 1.

        • rp object Required
          Hide rp attributes Show rp attributes object
          • name string Required

            Minimum length is 1.

          • id string Required

            Minimum length is 1.

        • user object Required
          Hide user attributes Show user attributes object
          • name string Required

            Minimum length is 1.

          • displayName string Required

            Minimum length is 1.

          • id string Required

            Minimum length is 1.

        • pubKeyCredParams array[object] Required

          At least 1 element.

          Hide pubKeyCredParams attributes Show pubKeyCredParams attributes object
          • type string Required

            Minimum length is 1.

          • alg number Required
        • authenticatorSelection object Required
          Hide authenticatorSelection attributes Show authenticatorSelection attributes object
        • timeout number Required
        • excludeCredentials array[object] Required

          At least 1 element.

          Hide excludeCredentials attributes Show excludeCredentials attributes object
          • type string Required

            Minimum length is 1.

          • id string Required

            Minimum length is 1.

    • user_id string Required

      Minimum length is 1.

POST /v1/auth/webauthn/registrations/begin
curl \
 --request POST 'https://api.streambird.io/v1/auth/webauthn/registrations/begin' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"domain":"localhost","user_id":"user_24wFP9pDa9YiMJLun94iKykoZs2"}'
Request example
{
  "domain": "localhost",
  "user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}
Response examples (200)
{
  "user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
  "public_key_credential_creation_options": {
    "publicKey": {
      "rp": {
        "id": "localhost",
        "name": "My App"
      },
      "user": {
        "id": "dXNlcl8yNmw3ZGJmQVk1OWZ0ZWptbTZtM09UZjRvejE=",
        "name": "John Smith",
        "displayName": "John"
      },
      "timeout": 60000,
      "challenge": "pz6ZOb3m7DnCLh+r7jFBymXY4N1Opz99hzAiVTTsRxU=",
      "pubKeyCredParams": [
        {
          "alg": -7,
          "type": "public-key"
        }
      ],
      "excludeCredentials": [
        {
          "id": "AQIWquELcChySRRIz9LpkduwNywFhzzKxsZye7Ms/t1noz72KiECL7tNSehkJGRwK22tlPdUBddfnyvjXQtfAJGa6oQ68D0LYLZlIleHyCin89yyZaZ9",
          "type": "public-key"
        }
      ],
      "authenticatorSelection": {
        "userVerification": "discouraged",
        "authenticatorAttachment": "platform"
      }
    }
  }
}