A AuthMS API Wiki API Reference iam.tianv.com →

POST /auth/webauthn/register/begin

生成注册挑战和凭证创建选项,返回给前端调用 navigator.credentials.create()

WebAuthn `bearerAuth` application/json

Request Body

Schema: handler.beginRegistrationRequest

FieldTypeRequiredExampleConstraintsDescription
password string Yes length: 1–?
user_name string Yes
display_name string No

Responses

StatusDescriptionSchema
200注册选项dto.WebAuthnRegistrationResponseWrapper
400请求参数错误dto.SimpleResponseWrapper
401未授权dto.SimpleResponseWrapper
500服务器错误dto.SimpleResponseWrapper

Referenced Schemas

dto.SimpleResponseWrapper

FieldTypeRequiredExampleConstraintsDescription
code integer No
message string No

dto.WebAuthnAuthenticatorSelection

FieldTypeRequiredExampleConstraintsDescription
authenticatorAttachment string No
residentKey string No
userVerification string No

dto.WebAuthnCredentialParameter

FieldTypeRequiredExampleConstraintsDescription
alg integer No
type string No

dto.WebAuthnRPEntity

FieldTypeRequiredExampleConstraintsDescription
id string No
name string No

dto.WebAuthnRegistrationOptionsResponse

WebAuthn navigator.credentials.create() 的 publicKey 参数

FieldTypeRequiredExampleConstraintsDescription
attestation string No
authenticatorSelection dto.WebAuthnAuthenticatorSelection No
challenge string No
pubKeyCredParams array of

See dto.WebAuthnCredentialParameter

No
rp dto.WebAuthnRPEntity No
timeout integer No
user dto.WebAuthnUserEntity No

dto.WebAuthnRegistrationResponse

FieldTypeRequiredExampleConstraintsDescription
publicKey dto.WebAuthnRegistrationOptionsResponse No

dto.WebAuthnRegistrationResponseWrapper

FieldTypeRequiredExampleConstraintsDescription
code integer No
data dto.WebAuthnRegistrationResponse No
message string No
timestamp string No

dto.WebAuthnUserEntity

FieldTypeRequiredExampleConstraintsDescription
displayName string No
id string No
name string No