Sunday, August 26, 2018

Key hash for Android-Facebook app

Trick from stackoverflow
The instructions currently in Facebook's Android Tutorial do not work well under Windows. Their example shows how to pipe the keytool output to openssl but if you try this under Windows the output is not valid for some reason.
Start by downloading openssl for Windows from Google.
C:\Users\Me>keytool -exportcert -alias my_key -keystore my.keystore -storepass PASSWORD > mycert.bin

C:\Users\Me>openssl sha1 -binary mycert.bin > sha1.bin

C:\Users\Me>openssl base64 -in sha1.bin -out base64.txt
After running these commands the valid hash is stored in the file base64.txt. Copy and paste this to your app settings on Facebook.

No comments:

Post a Comment