Redirect URI doesn't match with the one generated with package name and signature hash

Viewed 761

I've already searched too many links but my problem still in pending.

According to documentation on https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-android I'm try to integrate Microsoft Account in android where user can SignIn through it, but i'm facing issue to signIn user in app. When I run app it shows me an error com.microsoft.identity.client.exception.msalclientexception: 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.

My generated MSAL Configuration was

`com.example.microsoftintegrationandroid:host="com.example.microsoftintegration"{
  "client_id" : "0fcce5cd-946f-471b-953a-3948dc69d97e",
  "authorization_user_agent" : "DEFAULT",
  "redirect_uri" : "msauth://com.example.microsoftintegration/A%2FoARUpzRHfPOezOHJootAPRWJ8%3D",
  "authorities" : [
    {
      "type": "AAD",
      "authority_url": "https://login.microsoftonline.com/7233866a-c721-44ae-b426-6b0e8386199b"
    }
  ]
}`

but according to documentation my config file should resemble this example:

`{
  "client_id" : "0984a7b6-bc13-4141-8b0d-8f767e136bb7",
  "authorization_user_agent" : "DEFAULT",
  "redirect_uri" : "msauth://com.azuresamples.msalandroidapp/1wIqXSqBj7w%2Bh11ZifsnqwgyKrY%3D",
  "account_mode" : "SINGLE",
  "authorities" : [
    {
      "type": "AAD",
      "audience": {
        "type": "AzureADandPersonalMicrosoftAccount",
        "tenant_id": "common"
      }
    }
  ]
}`

and in file I've written JSON looks like this

`{
  "client_id": "0fcce5cd-946f-471b-953a-3948dc69d97e",
  "authorization_user_agent": "DEFAULT",
  "redirect_uri": "msauth://com.example.microsoftintegration/A%2FoARUpzRHfPOezOHJootAPRWJ8%3D",
  "account_mode": "SINGLE",
  "authorities": [
    {
      "type": "AAD",
      "authority_url": "https://login.microsoftonline.com/7233866a-c721-44ae-b426-6b0e8386199b"
    }
  ]
}` 

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, and redirect URI match whatever is shown in the portal.

I'd appreciate any suggestions

0 Answers
Related