安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
AuthenticatorResponse
接口在
Web 身份验证 API
is the base interface for interfaces that provide a cryptographic root of trust for a key pair. The child interfaces include information from the browser such as the challenge origin and either may be returned from
PublicKeyCredential.response
.
Below is a list of interfaces based on the AuthenticatorResponse interface.
AuthenticatorResponse.clientDataJSON
ArrayBuffer
, representing the client data that was passed to
CredentialsContainer.create()
or
CredentialsContainer.get()
.
None.
var options = {
challenge: new Uint8Array([/* bytes sent from the server */])
};
navigator.credentials.get({ "publicKey": options })
.then(function (credentialInfoAssertion) {
var assertionResponse = credentialInfoAssertion.response;
// send assertion response back to the server
// to proceed with the control of the credential
}).catch(function (err) {
console.error(err);
});
var publicKey = {
challenge: /* from the server */,
rp: {
name: "Example CORP",
id : "login.example.com"
},
user: {
id: new Uint8Array(16),
name: "jdoe@example.com",
displayName: "John Doe"
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7
}
]
};
navigator.credentials.create({ publicKey })
.then(function (newCredentialInfo) {
var attestationResponse = newCredentialInfo.response;
}).catch(function (err) {
console.error(err);
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
Web Authentication: An API for accessing Public Key Credentials Level 1
The definition of 'AuthenticatorResponse interface' in that specification. |
推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
AuthenticatorResponse
|
Chrome
67
|
Edge 18 |
Firefox
60
|
IE No | Opera No | Safari 13 | WebView Android 70 | Chrome Android 70 |
Firefox Android
60
|
Opera Android No | Safari iOS 13.3 | Samsung Internet Android No |
clientDataJSON
|
Chrome
67
|
Edge 18 |
Firefox
60
|
IE No | Opera No | Safari 13 | WebView Android 70 | Chrome Android 70 |
Firefox Android
60
|
Opera Android No | Safari iOS 13.3 | Samsung Internet Android No |
完整支持
不支持
见实现注意事项。
用户必须明确启用此特征。
AuthenticatorResponse