Redirect URI doesn't match with the one generated with package name and signature hash.
See original GitHub issueWhy the app always crash and saying that the URI doesn’t match with the one that showing on the AD? I’ve been tried to delete it and make a new one and that not helping either? Is this really a problem with the library either the AD or was that my mistake?
Here the Log:
Process: com.ilhamwahyu.testapp, PID: 10038
java.lang.IllegalStateException: The redirect URI in the configuration file doesn't match with the one generated with package name and signature hash. Please verify the uri in the config file and your app registration in Azure portal.
at com.microsoft.identity.client.PublicClientApplicationConfiguration.verifyRedirectUriWithAppSignature(PublicClientApplicationConfiguration.java:453)
at com.microsoft.identity.client.PublicClientApplicationConfiguration.checkIntentFilterAddedToAppManifestForBrokerFlow(PublicClientApplicationConfiguration.java:471)
at com.microsoft.identity.client.PublicClientApplication.initializeApplication(PublicClientApplication.java:1024)
at com.microsoft.identity.client.PublicClientApplication.<init>(PublicClientApplication.java:1006)
at com.microsoft.identity.client.MultipleAccountPublicClientApplication.<init>(MultipleAccountPublicClientApplication.java:72)
at com.microsoft.identity.client.PublicClientApplication$2.onTaskCompleted(PublicClientApplication.java:889)
at com.microsoft.identity.client.PublicClientApplication$2.onTaskCompleted(PublicClientApplication.java:870)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher$2.run(CommandDispatcher.java:179)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (9 by maintainers)
Top Results From Across the Web
android - Redirect URI doesn't match with the one generated ...
I can't figure out why this is happening because the config file's content was generated by Azure portal and package name, signature hash,...
Read more >msalclientexception redirect URI does not match - CodeRanch
On app run, I'm getting this exception MsalClient Exception: The redirect URI does not match with the package name and signature hash.
Read more >Redirect URL in Android app - Microsoft Q&A
They have to generate a new hash signature computed for their project (even if they are exactly the same) and put in into...
Read more >Azure Ad package Msal login for Android, iOS and MacOs
The redirect URI for the broker should include your app's package name and ... You can use keytool to generate a Base64-encoded signature...
Read more >OAuth 2.0 for Client-side Web Applications | Authorization
The redirect_uri passed in the authorization request does not match an authorized redirect URI for the OAuth client ID. Review authorized ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This had to be true all along that my Signature Hash was wrong. I follow the steps on Azure Portal but Android Studio gives me an error log. So I come across this. There was a code that I can use to Log the Signature Hash directly from the project.
This is the code.
Finally, I can make the right redirect_uri.
Thank you everyone for helping me out.
As an additional tip: For an APK already pushed to a device, there is a handy tool provided in the MSAL repo here which can export the signature hash of an app installed on a device. You can cross reference this value against your configuration in the application and in the Azure Portal.
Here’s a screenshot of our test app: