MSAL init failed: 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.

Rahul Maske 0 Reputation points
2025-08-23T08:30:15.9066667+00:00

MSAL init failed: 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.We expected 'msauth://secondAppDomain/firstApplicationGeneratedProductionSignature hash' and we received 'msauth://secondAppDomain/secondApplicationGeneratedProductionSignature.

I created an application in Azure Active Directory and added a redirect URI for one Android app, including its package name and generated production signature hash. Later, I created another redirect URI for a second Android application, following the same steps. However, I’m encountering an issue where the first application’s signature hash is still being expected for the second app. Even after removing the redirect URI for the first app, I am still getting the same error.

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michele Ariis 4,505 Reputation points MVP
    2025-08-23T12:29:41.55+00:00

    Hi, the error indicates that for the Android 2 app the redirect URI does not match what is recorded in Enter: calculate the SHA-1 of the certificate that actually signs the APK of app 2 and convert it to Base64 URL-safe (not SHA-256/hex; if you use Google Play App Signing get the SHA-1 “App signing certificate” from the Play Console), then in App registrations → Authentication add/recreate the Android platform with package = applicationId of app 2 and signature hash = the one just calculated (better a separate app registration for each app); in your app 2 put the correct client_id in msal_config.json and redirect_uri = msauth://<package2>/<hash2>, delete any remaining Android entries with package2 + hash1, then uninstall/reinstall (or clear cache/broker) and try again; Typical errors: package different from applicationId, bad/badly formatted hash (=/spaces), reusing msal_config.json from the first app.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.