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
      • publicKey object Required
        Hide publicKey attributes Show publicKey attributes
        • challenge string Required

          Minimum length is 1.

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

            Minimum length is 1.

          • id string Required

            Minimum length is 1.

        • user object Required
          Hide user attributes Show user attributes
          • 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
        • 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 \
 -X POST https://api.streambird.io/v1/auth/webauthn/registrations/begin \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"domain":"localhost","user_id":"user_24wFP9pDa9YiMJLun94iKykoZs2"}'
Request example
{
  "domain": "localhost",
  "user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}
Response examples (200)
{
  "public_key_credential_creation_options": {
    "publicKey": {
      "challenge": "pz6ZOb3m7DnCLh+r7jFBymXY4N1Opz99hzAiVTTsRxU=",
      "rp": {
        "name": "My App",
        "id": "localhost"
      },
      "user": {
        "name": "John Smith",
        "displayName": "John",
        "id": "dXNlcl8yNmw3ZGJmQVk1OWZ0ZWptbTZtM09UZjRvejE="
      },
      "pubKeyCredParams": [
        {
          "type": "public-key",
          "alg": -7
        }
      ],
      "authenticatorSelection": {
        "authenticatorAttachment": "platform",
        "userVerification": "discouraged"
      },
      "timeout": 60000,
      "excludeCredentials": [
        {
          "type": "public-key",
          "id": "AQIWquELcChySRRIz9LpkduwNywFhzzKxsZye7Ms/t1noz72KiECL7tNSehkJGRwK22tlPdUBddfnyvjXQtfAJGa6oQ68D0LYLZlIleHyCin89yyZaZ9"
        }
      ]
    }
  },
  "user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}