Initiate WebAuthn Registration (beta)
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.
Body
-
Required
Domain of the app that will be using WebAuthn to provide user sign in.Minimum length is
1
. -
Required
User ID of the user to attach this WebAuthn registration to.Minimum length is
1
. -
authenticator_type string
Optional
The intended authenticator type for the WebAuthn device used.cross-platform
is recommended for portable WebAuthn device like YubiKey andplatform
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
.
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"}'
{
"domain": "localhost",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}
{
"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"
}