Begin WebAuthn Registration
POST
/api/v1/webauthn/registration/begin
const url = 'https://api.spartanauth.com/api/v1/webauthn/registration/begin';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"transactionID":"example","sectorID":"example","keyName":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.spartanauth.com/api/v1/webauthn/registration/begin \ --header 'Content-Type: application/json' \ --data '{ "transactionID": "example", "sectorID": "example", "keyName": "example" }'Generates WebAuthn credential creation options for the authenticated user and stores the WebAuthn session in a transaction. Requires a valid bearer token and returns the transactionID needed to finish registration.
Request Body
Section titled “Request Body ” Media type application/json
object
transactionID
optional
string
sectorID
string
keyName
string
Example generated
{ "transactionID": "example", "sectorID": "example", "keyName": "example"}Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
options
object
challenge
string
rp
object
name
string
icon
string
id
string
user
object
name
string
icon
string
displayName
string
id
string
pubKeyCredParams
Array<object>
object
type
string
alg
integer format: int32
authenticatorSelection
object
authenticatorAttachment
string
requireResidentKey
boolean
residentKey
string
userVerification
string
timeout
integer format: int32
excludeCredentials
Array<object>
object
type
string
id
string
transports
Array<string>
extensions
object
key
additional properties
string format: byte
attestation
string
transactionID
optional
string
sectorID
string
Example generated
{ "options": { "challenge": "example", "rp": { "name": "example", "icon": "example", "id": "example" }, "user": { "name": "example", "icon": "example", "displayName": "example", "id": "example" }, "pubKeyCredParams": [ { "type": "example", "alg": 1 } ], "authenticatorSelection": { "authenticatorAttachment": "example", "requireResidentKey": true, "residentKey": "example", "userVerification": "example" }, "timeout": 1, "excludeCredentials": [ { "type": "example", "id": "example", "transports": [ "example" ] } ], "extensions": { "additionalProperty": "example" }, "attestation": "example" }, "transactionID": "example", "sectorID": "example"}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}