Android CredentialManager: GetCredentialResponse error returned from framework

583 Views Asked by At

I'm testing the abilities of the Android Credential Manager APIs to work with passkeys over W3C standards. While everything is set up and works I'm getting the following errors inconsistently :

  1. While registering a new passkey sometimes (about 10% of the tries) I'm getting an exception from CredentialManager: CreatePublicKeyCredentialDomException: The incoming request cannot be validated The officials say: The app's package ID is not registered with your server. Validate this in your server-side integration. but it is set-up and 9 out of 10 calls succeed what proves that it is working.
  2. While getting passkey from the CredentialManager API inconsistently the APIs prompts me to scan QR with other device (I assume it cannot retrieve my passkey on current device) and the only output I can get from it is: GetCredentialResponse error returned from framework

I've tried to find the answers for days, any help would be appreciated. Thanks in advance.

2

There are 2 best solutions below

1
Mohmmaed-Amleh On BEST ANSWER

I dealt with a similar issue and i was use site.glitch.me as google code lab and i use it as relying party for testing.

but after i make my assetlinks.json and deploy it on my server everything works fine.

0
cwiesner On

I dealt with a similar issue where the getCrendentials() request for passkeys failed most of the time.

Turned out that the challenge payload that is sent with the request was not properly base-64 encoded. After checking the device logs (without any filter) I found the CredentialManager was logging bad base-64 The challenge was lacking URL-safe encoding therefore most of the challenge payloads where corrupted, resulting in those failures.