Solution 1 :
I test the sample code and it works fine.
Make sure that you need to follow this part to configure your Azure AD app.
There are two files need to be configured: AndroidManifest.xml
and auth_config.json
.
My configuration for your reference:
auth_config_multiple_account.json
{
"client_id" : "6cXXXXa2-295d-455a-88fe-b1XXXXXXXX0e",
"authorization_user_agent" : "DEFAULT",
"redirect_uri" : "msauth://com.azuresamples.msalandroidapp/1wIqXSqBj7w%2Bh11ZifsnqwgyKrY%3D",
"authorities" : [
{
"type": "AAD",
"audience": {
"type": "AzureADandPersonalMicrosoftAccount",
"tenant_id": "common"
}
}
]
}
AndroidManifest.xml
<data
android_host="com.azuresamples.msalandroidapp"
android_path="/1wIqXSqBj7w+h11ZifsnqwgyKrY="
android_scheme="msauth" />
Azure AD app
Problem :
I have to integrate Microsoft authentication API for login in the android app. for that I registered my app to the Azure portal, by providing a package name and Signature hash.
Signature hash is generated using this command
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.androiddebug.keystore | openssl sha1 -binary | openssl base64
on app run, I’m getting this exception
MsalClient Exception: The redirect URI does not match with the package name and signature hash.
but both the package name and signature hash is the same at android and Azure. im following this tutorial
https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-android
Comments
Comment posted by Allen Wu
Hi did you have a chance to look into my update in comment under answer? Is it helpful?
Comment posted by Allen Wu
@iSevaDigital You need to specify the path. My example for your reference:
Comment posted by stackoverflow.com/questions/7506392/…
@iSevaDigital You can also refer to