认证接口

认证接口

整个认证过程分两个接口,一个是获取认证挑战 challenge,一个是进行实际认证。

webauthn-authentication-flow-01

预认证

POST /ta-fido-server/preauthenticate

1、鉴权Header

Host: api.wekey.com
X-Wekey-Date: 20150830T123600Z
Authorization: WEKEY-HMAC-SHA256 host;x-wekey-date,fe5f80f77445342fe2855ddc963176630326f102d5fa3beca038a248ff027d04

2、请求参数

名称 类型 必填 描述 示例
rpId string 调用者在wekey分配的ID example.com
userId string Base64url encoded用户ID MQ==
username string 用户名 xiaoming
extensions object 扩展选项
userVerification string 选项 required

2、返回参数

名称 类型 描述
code int 错误码,0 为OK
data object publicKey,PublicKeyCredential对象,可直接调用window.create
error string 错误码不为0时有值

认证

POST /ta-fido-server/authenticate

1、鉴权Header

Host: api.wekey.com
X-Wekey-Date: 20150830T123600Z
Authorization: WEKEY-HMAC-SHA256 host;x-wekey-date,fe5f80f77445342fe2855ddc963176630326f102d5fa3beca038a248ff027d04

2、请求参数

名称 类型 必填 描述 示例
rpId string 调用者在wekey分配的ID example.com
object PublicKeyCredential对象,由webauthn api: window.create 产生

2、返回参数

名称 类型 描述
code int 错误码,0 为OK
data
error string 错误码不为0时有值