face id/touch id supports ios safari

This commit is contained in:
MaysWind
2020-11-22 23:53:52 +08:00
parent ae5af160c9
commit dc78f5fa7e
4 changed files with 43 additions and 23 deletions
+8 -6
View File
@@ -7,26 +7,28 @@ const publicKeyCredentialCreationOptionsBaseTemplate = {
authenticatorSelection: {
authenticatorAttachment: 'platform',
requireResidentKey: false,
userVerification: "required"
userVerification: "discouraged"
},
pubKeyCredParams: [
// https://www.iana.org/assignments/cose/cose.xhtml#algorithms
{type: "public-key", alg: -7}, // ECDSA w/ SHA-256
{type: "public-key", alg: -257}, // RSASSA-PKCS1-v1_5 using SHA-256
],
timeout: 1800000
timeout: 120000
};
const publicKeyCredentialRequestOptionsBaseTemplate = {
allowCredentials: [{
type: 'public-key'
}],
userVerification: "required",
timeout: 1800000
}
userVerification: "discouraged",
timeout: 120000
};
function isSupported() {
return !!window.PublicKeyCredential && !!navigator.credentials;
return !!window.PublicKeyCredential
&& !!navigator.credentials
&& utils.isFunction(window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable);
}
function isCompletelySupported() {