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
-
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
. -
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 \
--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"}'
{
"domain": "localhost",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}
{
"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"
}
}
}
}