android / identity-samples

Multiple samples showing the best practices in identity on Android.
Apache License 2.0
322 stars 198 forks source link

Passkey codelab doesn't work getting : "The incoming request cannot be validated" everytime #63

Closed MayurHebbar04 closed 4 months ago

MayurHebbar04 commented 4 months ago

I tried to follow Android Passkey codelab steps. I'm consistently encountering an exception error while attempting to sign up for a passkey : The incoming request cannot be validated

The asset links looks like this:

[
  {
    "relation" : [
      "delegate_permission/common.handle_all_urls"
    ],
    "target" : {
      "namespace" : "web",
      "site" : "${SITE}"
    }
  },
  {
    "relation" : [
      "delegate_permission/common.handle_all_urls",
      "delegate_permission/common.get_login_creds"
    ],
    "target" : {
      "namespace" : "android_app",
      "package_name" : "${applicationId}",
      "sha256_cert_fingerprints" : [
        "${SHA256_CERT_FINGERPRINT}"
      ]
    }
  }
]

Created a strings.xml file:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- TODO -->
    <string name="asset_statements" translatable="false">
  [{
    \"https://${ourSiteDomain}/.well-known/assetlinks.json\"
  }]
  </string>
</resources>

Even added meta-data to the Manifest (tried with and without)

<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />

Could someone from the Google team assist with resolving the recurring 'The incoming request cannot be validated' exception?

MayurHebbar04 commented 4 months ago

Hi Team, the feature is functioning correctly on Android 14 devices but encountering issues on devices running Android versions below 14, such as Android 13 and 12. Please help to address this discrepancy. Thank you!

MayurHebbar04 commented 4 months ago

we solved the problem and the passkeys are working, hence closing the issue

marcus-sa commented 3 months ago

@MayurHebbar04 how did you solve it?