Unable to launch passkey login with security-keys option when implementing passkey on Android

109 views Asked by At

Does anyone know how can I launch passkey login with security-keys option like the attached image?

I am using following credentials library version.

  • "androidx.credentials:credentials-play-services-auth:1.0.0-alpha09"
  • "androidx.credentials:credentials:1.0.0-alpha09"

image

I tried the change the userVerification or add hints but nothing works. The request json is from example:

{ 
  "allowCredentials": [], 
  "challenge": "DVoOX3w1puCL-hMzfi9uIm9TpIfgF7NG1PA9p23MHjU",
  "hint": ["security-keys"],
  "rpId": "xxx.com",
  "timeout": 180000,
  "userVerification": "discouraged"
}
1

There are 1 answers

5
Ayman Bedair On

If you want to force security key options, you would need to specify the required authenticator attachment as cross-platform:

"authenticatorSelection": {
    "authenticatorAttachment": "cross-platform"
}

Reference: https://www.w3.org/TR/webauthn-2/#roaming-authenticators