Key hash is secure encrypted key created by mobile application developer from his own computer system. Key hash authenticates the information between your application and Facebook server. Adding key hash in Facebook developers console is mandatory and if you want to use the Facebook Login in your android mobile application then you have to add the key hash. In this tutorial we would Generate Release key hash for Facebook Login in Android devices. We would generate the key has in our windows system. Using this tutorial you can generate key hash in any windows system. So let’s get started :).
Contents in this project Generate Release key hash for Facebook Login in Android App in Windows System:
1. Download Open SSL software from Google Code.
2. Extract the OpenSSL in your C drive like i did in below screenshot.
3. Now you need to locate the debug.keystore file which will be present in your .android folder. Location of .android folder is C:UsersYourUserName.android . Simply copy the debug.keystore file.
4. Now we need to paste the copied debug.keystore file into your JDK’S BIN folder. My JDK’s bin folder is located at C:Program FilesJavajdk1.8.0_92bin . Paste the copied file here.
5. Start Command Prompt as Run as Administrator mode & Open the JDK’S bin folder in CMD.
6. Paste the below line of code and press enter. It will ask you a password so enter android as password.
1
|
keytool –exportcert –alias androiddebugkey –keystore debug.keystore > c:opensslbindebugkey.txt
|
7. Next step is to open the OpenSSL’s bin folder in command prompt. Like i did in below screenshot.
1
|
openssl sha1 –binary debugkey.txt > debug_hash_key.txt
|
9. Again execute below command.
1
|
openssl base64 –in debug_hash_key.txt > debug_real_key.txt
|
Here you go guys. Now Goto OpenSSL -> bin folder. Here you would find a file named as debug_real_key.txt . This file contains the real release key hash.