【发布时间】:2021-06-29 03:33:39
【问题描述】:
我正在尝试与 WebAuthn 集成以进行用户身份验证。
下面是我目前使用的代码:
const credOptions = {
publicKey: {
rp: {
name: 'test inc',
id:'login.test.com'
},
user,
authenticatorSelection: {
authenticatorAttachment: 'platform',
requireResidentKey: true,
userVerification: 'preferred'
},
pubKeyCredParams: [
{
type: 'public-key',
alg: -7
}
],
attestation: 'direct',
timeout: 60000,
challenge
}
};
try {
const cred = await navigator.credentials.create(credOptions);
return cred;
} catch (e) {
console.log(e);
}
问题
- 在下面的屏幕截图中,我是否可以更改 WebAuthn 提示/对话框中显示的“登录”和“您要...”下的文本用于 FaceID 或 TouchID。
- 基本上我想在这两个字段中显示自定义文本,例如:
-
Sign In-->Enroll -
Do you want to allow "login.com" to use FaceID-->Do you want to allow "Paypal" to use FaceID?
-
我尝试更改 credOptions 中的依赖方(rp) 信息,但没有看到预期的结果。
如果可行,谁能指导一下。
【问题讨论】:
标签: javascript dialog prompt mobile-website webauthn