I try to authentificate my xamarin app on azure.
To create the Base64 encoded SHA1 hash for my debug.keystore i used the suggested command:
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64
I get a result but it has 32 characters and gets rejected from azures frontend validation with the message:
The signature hash must be a Base64 encoded SHA1 hash.
If i use the placeholder or a substring of my hash it is working
2pmj9i4rSx0yEb/viWBYkE/ZQrk= <- `Example from Azure (is working)`
aPz8/NARbPz8pPzg/Iz9aPz8NCg= <- `some working example generated by me`
CAY/Pz8/NARbPz8pPzg/Iz9aPz8NCg== <- `My base64 (is not working)`
it seems like that azure needs always 28 characters but my generated base74 has 32...
I wasted 20 hours on this problem but diddnt find any solution.
I just encountered this same issue. AzureAd does not seem to want openssl sha1 -binary | openssl base64
I had to open up gradle on android/app/build.gradle
open up app/tasks/android -> signingReport
grab the sha1 from there in the form of xx:xx:xx...xx:xx
convert to base 64 here: https://base64.guru/converter/encode/hex
hope this helps
Not enough rep to comment on Jorge Luiz's post, but I had to complete an additional step to make this method work. My full solution was this:
Do not build Gradle task list during Gradle sync
Then follow the steps as in Jorge's post, which I will recap here. If the task does not appear, you may need to sync your gradle files again. You can find this option under File -> Sync project with gradle files. Then follow these steps:
signingReport
task (<projectname>(/app)/Tasks/android/signingReport
)The Run tab should automatically open, then from there you:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With