Skip to content

Error: [50152] RP ID cannot be validated on Android #68

Closed

Description

@timmyjose

Platform: Android (Device/Emulator), iOS works.

(Note: Using expo with a prebuild/CNG flow).

When I try to create the account (using the example code):

Error: [50152] RP ID cannot be validated.

I've tried:

Testing https://webauthn.io in the Emulator worked.

I'm out of ideas. I can't find any information on this error beyond Native Android threads, which still don't give any concrete help.

Activity

  1. changed the title [-]Error: [50152] RP ID cannot be validated.[/-] [+]Error: [50152] RP ID cannot be validated on `Android`[/+] on Jun 5, 2025
  2. timmyjose commented on Jun 5, 2025

    @timmyjose
    Author

    Also, does the app need to have been published in the Play Store? Right now, I'm using the debug keystore SHA256, and the Google assets validator (https://developers.google.com/digital-asset-links/tools/generator) shows:

    Image

  3. mdipanjan commented on Jun 6, 2025

    @mdipanjan

    I'm testing a basic version myself and I'm also getting this same error on Andoid emulator as well as on a real android device.

    Image
  4. timmyjose commented on Jun 8, 2025

    @timmyjose
    Author

    @mdipanjan

    I did read somewhere that only Android 14 and above is supported, but even with an emulator on Android 15, we still get this error.

    I think the issue might be with the SHA-256 for the debug build (for assetlinks.json), but can't be sure. I tried creating an internal build in the Play Store for the prototype I'm working on, but that didn't work either.

  5. mdipanjan commented on Jun 9, 2025

    @mdipanjan

    It did work for me on Andorid 15 emulator on my local debug build @timmyjose

  6. timmyjose commented on Jun 10, 2025

    @timmyjose
    Author

    @mdipanjan Nice! That's encouraging to hear.

    How did you set up the assetlinks.json part? Could you please share some details?

    For me:

    • I created a custom domain in firebase cloud
    • I created an assetlinks.json file inside /.well-known like so:
    [{
      "relation": ["delegate_permission/common.get_login_creds"],
      "target" : { "namespace": "android_app", "package_name": "<android package name here>",
                   "sha256_cert_fingerprints": ["<SHA-256 from keytool output using debug keystore"] }
    },
    {
      "relation": ["delegate_permission/common.get_login_creds"],
      "target" : { "namespace": "web", "site": "<my firebase custom domain>" }
    }]
    
    

    (I'm using expo, but that shouldn't make a different, I suppose).

  7. timmyjose commented on Jun 10, 2025

    @timmyjose
    Author

    (Just tried with Android 16 as well - same error for me).

  8. mdipanjan commented on Jun 10, 2025

    @mdipanjan

    Hello @timmyjose so in my case I'm using an node.js server and that looks like this:

    fastify.get("/.well-known/assetlinks.json", async (request) => {
      return [{
        relation: [
          "delegate_permission/common.handle_all_urls",
          "delegate_permission/common.get_login_creds"
        ],
        target: {
          namespace: "android_app",
          package_name: process.env.APP_PACKAGE_NAME,
          sha256_cert_fingerprints: [process.env.WEBAUTHN_ANDROID_CERT_FINGERPRINTS]
        }
      }];
    });
    

    And in the android file:

    myApp/android/app/src/main/res/values/strings.xml

    Have included this (for https serving over ngrok):

    <resources>
        <string name="app_name">myApp</string>
        <string name="asset_statements" translatable="false">
            [{
                \"include\": \"https://xyz.ngrok-free.app/.well-known/assetlinks.json\"
            }]
        </string>
    </resources>
    

    I hope this helps to resolve your issue.

  9. timmyjose commented on Jun 11, 2025

    @timmyjose
    Author

    Thank you, @mdipanjan! Appreciate it!

    That is very helpful indeed! So I made the changes by comparing your assetlinks.json and strings.xml:

     ERROR  {"error": "Native error", "message": "Error: The incoming request cannot be validated"}
    

    a different error now, but that's still some progress! I'll try and debug this issue and see.

    Since your setup is working, it gives me confidence that my issue must be some annoying configuration issue!

  10. mdipanjan commented on Jun 13, 2025

    @mdipanjan

    @timmyjose you got this. The error you see now, I was getting it at some point and some change the configuration might resolved it for me.

    I'm certain you need some tweek in the config and it'll work. My registration was working but had issue with login and this issue thread helped me. Leaving it here if this might help you too.

    Also take a look at this medium article series which helped me a lot in my POC implementation. Hope these help.

  11. timmyjose commented on Jun 13, 2025

    @timmyjose
    Author

    Thank you, @mdipanjan ! I'll have a look at the linked resources, and hopefully it should steer me towards resolving these nagging issues!

  12. wilmxre commented on Jul 17, 2025

    @wilmxre

    @timmyjose hi, i just faced the same Error: [50152] RP ID cannot be validated error, did you manage to fix this issue?

  13. timmyjose commented on Jul 17, 2025

    @timmyjose
    Author

    @wilmxre Sadly, no. I tried everything, including the excellent resources linked to by @mdipanjan , but no luck.

  14. wilmxre commented on Jul 18, 2025

    @wilmxre

    @timmyjose in the meanwhile i discovered on a Samsung device, that if i go with Samsung Pass as the passkey manager, i can register the passkey successfully. with the Google Password Manager option, i still get Error: [50152] RP ID cannot be validated. so there must be something with how GPM is validating the credentials.

  15. abc910804 commented on Jul 29, 2025

    @abc910804

    I get this same error and have already tried every solution I could find online, but I still can’t fix it. I’m not sure if anyone has managed to solve it.

  16. duy99uit commented on Aug 20, 2025

    @duy99uit

    i had the same problem, but finally after a few days realized that the .well-known/assetlinks.json file was the problem, i put all sha256 keys (both 3 keys) and asked the service team to upload again and it worked

  17. f-23 commented on Oct 2, 2025

    @f-23
    Owner

    It's definitely a configuration issue since this package pretty much passes the request straight to the native androidx credentials handler. If any errors are thrown they'll come from there.
    Make sure your sha256 fingerprint matches the correct signing key. It can be a bit finicky unfortunately, but if you follow the docs/readme it will work.

  18. kinghoddy commented on Oct 28, 2025

    @kinghoddy

    For me the fix was to make sure i was using a Play Store fingerprint key hash not the one generated by expo during build, also the associatedLinks.json. has to have the right package name.

    delegate_permission/common.get_login_creds must be included in relation array, not just delegate_permission/common.handle_all_urls

    Finally, test on a real device

  19. gcoro commented on Dec 4, 2025

    @gcoro

    I had the same issue, for me the fix was to match the rpId passed to the library to exactly the domain in which assetlinks.json is served (including the subdomain, if present)

    eg. my file is here https://mydomain.com/.well-known/assetlinks.json

    so I need to put in the payload

    		const input: PasskeyCreateRequest = {
    				rp: {
    					id: "mydomain.com",
                                             ....
    
  20. github-actions commented on Mar 5, 2026

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  21. plgrazon commented on Mar 20, 2026

    @plgrazon
    Contributor

    @wilmxre encountering the same issue were you able to solve this?

  22. victorsferreira commented on Mar 20, 2026

    @victorsferreira

    Same here. Tried everything
    Worker in a real device with Samsung Pass, but does not work with Google Password Manager, both on real device and Emulator

  23. plgrazon commented on Mar 20, 2026

    @plgrazon
    Contributor

    @victorsferreira

    "delegate_permission/common.get_login_creds" 
    "delegate_permission/common.handle_all_urls"
    

    on your assetlinks.json do you have both?

  24. anhtuanmai commented on May 8, 2026

    @anhtuanmai

    It work for me. Thanks @mdipanjan and @plgrazon

    "delegate_permission/common.get_login_creds" 
    "delegate_permission/common.handle_all_urls"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions