Open Prabhakaran-Ganesan opened 3 years ago
@rpdome - Hi Dome , Prabhakaran has followed your steps to Invalidate caches and Restart in android however the result is same and the application is still not working as per the shared device mode. Please suggest here.
@Prabhakaran-Ganesan Could you please try debugging with the code in the following function - and see what signature hashes you're getting?
@rpdome Using the above code, I have got a different signature instead of the one generated with my keystore. Then I changed my project configs and azure portal with this new signature.
After this the problem got resolved.
For clarification, I have created another new sample project and new key store. Here also the same issue occurred. Again I used the above code to solve the problem.
Below are the steps I followed.
keytool -exportcert -alias myalias -keystore "E:\Keystore\testkey.jks" | "E:\openssl-0.9.8k_X64\bin\openssl.exe" sha1 -binary | "E:\openssl-0.9.8k_X64\bin\openssl.exe" base64
After entering the password, I have got the signature hash. Then I inlcuded this in my azure app registration to get the configuration file.
The signed release apk was generated using Android studio.
The same error occured after installing the apk.
I used the same code to verify the signature but I found a different one.
Then I changed the signature hash in my project and azure app registration with the one found above
The issue got solved.
Here What I observed is that the issue got solved by using the signature hash obtained using the code and also it is not matching with the signature generated with the following command line
keytool -exportcert -alias SIGNATURE_ALIAS -keystore PATH_TO_KEYSTORE | openssl sha1 -binary | openssl base64
(Same occurred for debug signature too)
Is this a bug or am I missing something?
@Prabhakaran-Ganesan I'm suspecting that
keytool -exportcert -alias myalias -keystore "E:\Keystore\testkey.jks"
and see if you're getting something out?Greetings, @rpdome
I have verified the input path and also I got the prompt for password as well but still getting the same signature. As suggested , I have got the following result upon executing the command
keytool -exportcert -alias myalias -keystore "E:\Keystore\testkey.jks"
Dear @rpdome ,
We are awaiting for your response.
Thanks and Regards Prabhakaran
Confirmed @rpdome, This is a bug that was resolved by adding z to the end of my package name. Thank you @Prabhakaran-Ganesan for finding it.
Minimal steps to reproduce
Download the sample from this link (https://github.com/Azure-Samples/ms-identity-android-java/)
Set up the Authenticator App using this tutorial (https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-shared-device-mode)
Register an app in the azure active directory and add an android platform in the authentication section
Generate a config file by providing package name and signature hash
Then open the sample app and open the auth_config_single_account.json file and replace content with the file generated from the App registration in Azure Active directory
Open AndroidManifest.xml file and change the data path value in BrowserTabActivity (Line No. 35) with the generated signature hash
Run the app
On opening the app, it is showing the following exception.
I have found a workaround for removing this error as follows. But this workaround doesn’t make the application to run in Shared-Device mode and the app is working in regular mode only even though the “mSingleAccountApp.isSharedDevice()“ returns ‘true’
Workaround steps
Add a extra character like typo in the redirect uri in the config file as shown below and also include this redirect uri in the app registration in the azure active directory
ORIGINAL
WORKAROUND
Also change the same in the AndroidManifest.xml (Line No. 34)
ORIGINAL
WORKAROUND
Please help me resolve this issue.
Device Details
@rpdome For traceability, mentioning the microsoft support ticket number 120120326004885
Mention any other details that might be useful