Redirect URL in Android app

LOOS Ayméric 96 Reputation points
2021-05-18T13:43:34.88+00:00

Hello everyone !

I am currently developing an android app requiring the power of Microsoft authentication and its API Graph. The objective is to offer users the possibility to find friends into the same tenant (i.e University) by using Graph.

However, there is something I didn't actually understand about redirect URLs we have to add on Azure App registration. My colleagues cannot make request using my URL specified into the JSON provided by Azure:

{
"client_id" : "a506XXXX",
"authorization_user_agent" : "BROWSER",
"redirect_uri" : "msauth://com.example.myfirstapp/OizXXXXXXXXX",
"broker_redirect_uri_registered" : true,
"account_mode" : "SINGLE",
"authorities" : [
{
"type": "AAD",
"audience": {
"type": "AzureADMyOrg",
"tenant_id": "XXXXX"
}
}
]
}

Do all developers have to specify a different redirect URL based on their project signature ? It seems to be weird because once the app in production launched, there will be only one redirect URL ...

Many thanks for your help

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,113 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,903 questions
0 comments No comments
{count} votes

Accepted answer
  1. LOOS Ayméric 96 Reputation points
    2021-05-21T07:47:30.173+00:00

    Let us explain the problem properly. There are in fact two different hashes when registering an app on Azure portail.

    • One is used for developing the app and all developers have to specify their own signature because their environment differ.
    • One is used for releasing your app in production. This kind of hash is unique and all developers can use the same hash.

    In case of an Android app, Android studio will compute a debug key which is not what we want when releasing in production mode. The portion of code provided above computes a debug hash which is in fact linked with the development hash signature called by Microsoft.

    below a screenshot of the panel displayed on the Azure portail where you can find these two hashes:

    98457-captureazureconfigurationwithfocus.png

    To conclude, be careful of what you want and what Microsoft provides.


1 additional answer

Sort by: Most helpful
  1. Saurabh Sharma 23,821 Reputation points Microsoft Employee
    2021-05-19T00:13:37.393+00:00

    Hi @LOOS Ayméric ,

    Thanks for using Microsoft Q&A !!

    Redirect uri is associated with your application and not for each individuals so if your other developers are creating different apps then they need to use different redirect URI's as they have different application registrations. If they are trying to working on the same application URI needs to be the same. Can you please provide more details how your colleagues are trying to using your redirect_uri and what is the error they are getting ?
    Please refer to Quickstart: Sign in users and call the Microsoft Graph API from an Android app for code sample. Also, please refer to Android Microsoft Authentication Library configuration file for additional details.

    Thanks
    Saurabh

    1 person found this answer helpful.

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.