Initiate WebAuthn Authentication (beta)
Initiate a WebAuthn authentication request. This endpoint requires that a user has at least one WebAuthn credential attached for the provided domain
from a successful CreateWebAuthnRegistration
. Pass the JSON object in public_key_credential_request_options
property into await get(options)
as options
if you are using webauthn-json or to navigator.credentials.get(options).
HTTP Request
POST /v1/auth/webauthn/authentication/begin
Returns
A successful response returns a public_key_credential_request_options
property and user_id
property.
POST
/v1/auth/webauthn/authentication/begin
curl \
-X POST https://api.streambird.io/v1/auth/webauthn/authentication/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_request_options": {
"publicKey": {
"challenge": "D9qznnlmk+o70AZ4IFF7zG1jUaRYzW1Z0dqZ2OEDGU4=",
"timeout": 60000,
"rpId": "localhost",
"allowCredentials": [
{
"type": "public-key",
"id": "AQfPElkPCEeuVoNqtVNAqi8nUNlE3gLKTZKzH9hTt0YQMCPGkRpMAV8ECi1Oexr1hBPYHj6B8E5O6n8Wqhu4Tkkq75wFIrmhnz5CB9NhSeIZZlzmeg=="
},
{
"type": "public-key",
"id": "AWvXz2Dx+I+te0xgEFpnYRFvakhELv/tEmlQ68137Rlcl6+ZN0/8PIqN6e+lN5sXFUy5+HJsdDFUaYgQoVf0ORLF1UIQnuthZi9a742mCzR9G72Bjg=="
},
{
"type": "public-key",
"id": "Aex6qH/dUebV6v43lypXMBWzi8Okem5kik0iL9IYAX3ixRcBrCqIiJR3lhzK2rnAV0jY9IcWQe3sGEeP9vLm6J/lzs9JwRMpZ2pa8aT8db6YiQFeOg=="
}
],
"userVerification": "discouraged"
}
},
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}