-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The SDK should fetch the 'redirect_uri' programatically instead of fetching it from the MSAL configuration file #2013
Comments
@umangmathur92 Really appreciate the detail investigation and suggestion. We plan to address this issue to make experience with sample better. I would also like to connect with you to learn more about your experience with MSAL if you have further feedback. Please email me at [email protected] and I will schedule a call for us. |
@negoe Yes. I'd like to get on a call to discuss this further. |
@negoe do you have more information about the issue? I'm facing some issue only when the app downloaded from google play store. |
@umangmathur92 Just checking if you sent an email, hope it did not land in my junk folder. |
An Android APK can have 3 unique signatures/signing-key:
The MSAL config file contains the
redirect_uri
. Theredirect_uri
consists of theBASE64_URL_ENCODED_PACKAGE_SIGNATURE
. The SDK needs this config file to function properly. Since there are 3 possible unique package signatures - this mandates 3 unique config files with differentredirect_uri
.Right now, I am able to switch between MSAL config files depending on whether it is a debug build or a release build. i.e., I am able to switch between 2 different MSAL config files (gradle allows me to specify certain attributes based on the build type - release or debug). However, there are 3 unique keys that may be used to sign the APK and gradle allows us to specify just 2 build types.
redirect_uri
structure:msauth://<YOUR_PACKAGE_NAME>/<YOUR_BASE64_URL_ENCODED_PACKAGE_SIGNATURE>
Inside the app-level
build.gradle
file:Inside
AndroidManifest.xml
:What this implies is that at any given point of time, at least one of the 3 APKs don't allow me to sign in using Microsoft. I do not face the same issue while using a google Sign in SDK or Facebook login SDK because those SDKs programmatically fetch the package-signature(keystore hash).
My use-case:
As of today I am unable to distribute 'Release APK' to customers directly because gradle allows me to choose between just 2 possible configurations even though there are 3 uniquely signed APKs.
Preferred Solution
The SDK should fetch the 'redirect_uri' programatically instead of fetching it from the MSAL configuration file. No other popular authentication SDK forces developers to manually specify the package signature.
The
verifyRedirectUriWithAppSignature()
method insidecom.microsoft.identity.client.PublicClientApplicationConfiguration.java
already contains similar code albeit used for verification purposes.Alternative Solution2
Would the following approach to modifying the IntentFilter for the
BrowserTabActivity
work ?Inside AndroidManifest.xml:
Alternative SDKs
Google, Facebook login SDKs work flawlessly and there is no such limitation when I use those SDKs. The paradigm being used in the MSAL-Android SDK is sub-optimal in my opinion.
The text was updated successfully, but these errors were encountered: