As part of a POC I am trying to implement a functionality to create passkey from Android native mobile application. But I am getting following error code when I execute the passkey code:
androidx.credentials.exceptions.publickeycredential.CreatePublicKeyCredentialDomException: [50152] RP ID cannot be validated. same error
This how the Digital Asset Links configuration looks like:
{"relation" : [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"],"target" : {
"namespace" : "android_app",
"package_name" : "package name",
"sha256_cert_fingerprints" : [
"SHA1 fingerprint"
]
}
},
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "web",
"site": "domain name"
}
}
]
Google Developer Link For Passkey Medium Link for Passkey Implementation
In my case I figured out that passkeys only worked with an app build signed by the Google signing key (eg by uploading a new release for internal testing). This was because I only used the fingerprint (located in Play Console > Test and Release > Setup > App Signing) of this Google signing key in my assetslinks.json file.
However this signing key in stored securely on a Google server and I can not access it for signing my debug builds.
debug.keystoreTo also test the passkey creation with your debug build, you need to either add the release signing config to your debug build (which might be infeasible in my situation), or add the fingerprint of the debug.keystore to your assetlinks.json.
keytool -list -keystore <path-to-debug.keystore> to get the fingerprint of the keystore. The default password is "android".sha256_cert_fingerprints in your assetlinks.json fileWith this I was able to get rid of the RP ID cannot be validated error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With