Get registration options¶
Get registration options for WebAuthn (passwordless authentication) credential registration
- HTTP Method:
GET
- URL:
https://example.domain.tld/api/v1/webauthn/registration/options/
- Require authentication:
Yes
- Permission level required:
MasterAdmin
/DomainAdmin
/MailUser
Response parameters¶
See example response below.
These options can be passed to browser’s navigator.credentials.create()
method or to a library like SimpleWebAuthn.
For details of WebAuthn, see its W3C specification or MDN docs.
Example request (Python)¶
import requests
import json
from pprint import pprint
url = "https://example.domain.tld/api/v1/webauthn/registration/options/"
r = requests.get(url, auth=("masteradmin2","long-auth_token-here"))
try:
pprint(r.json())
except:
print(r.text)
Example response (JSON)¶
{
"attestation": "none",
"authenticatorSelection": {
"requireResidentKey": true,
"residentKey": "required",
"userVerification": "preferred"
},
"challenge": "L2naEZ0vOCG-AxeY6tE_8891sYFLWraDsOh0aWtbGqU9HKrvXFBnD2q8_oes41DApw1_hWmplpQl6bgwr6B2PA",
"excludeCredentials": [],
"pubKeyCredParams": [
{
"alg": -7,
"type": "public-key"
},
{
"alg": -8,
"type": "public-key"
},
{
"alg": -36,
"type": "public-key"
},
{
"alg": -37,
"type": "public-key"
},
{
"alg": -38,
"type": "public-key"
},
{
"alg": -39,
"type": "public-key"
},
{
"alg": -257,
"type": "public-key"
},
{
"alg": -258,
"type": "public-key"
},
{
"alg": -259,
"type": "public-key"
}
],
"rp": {
"id": "demo.mymailcheap.com",
"name": "demo.mymailcheap.com"
},
"timeout": 60000,
"user": {
"displayName": "masteradmin2",
"id": "MTI",
"name": "masteradmin2"
}
}