Wednesday, May 30, 2012

Generating Hashkey for Android Facebook Application Integration

Step 1

Step 2

Extract to a folder (in my case d:\android\openssl)

Step 3

Copy your debug.keystore file to the Java JDK folder where keytool.exe is present
In my case debug.keystore was in C:\Users\hemant\.android\debug.keystore
keytool.exe was in D:\Program Files\Java\jre7\bin folder

Step 4

Open the command prompt in the jdk bin folder where keytool.exe is and execute the following command:
keytool -exportcert -alias androiddebugkey -keystore debug.keystore > d:\android\openssl\bin\debugkey.txt
Provide password as android when prompted

Step 5

Navigate to openssl\bin folder (here we have debugkey.txt) in the command prompt and execute the following commands:
a.       openssl sha1 -binary debugkey.txt > debugkey_sha.txt
b.      openssl base64 -in debugkey_sha.txt > debugkey_base64.txt

That’s it! We are done. The debugkey_base64.txt contains the hashvalue. We need to copy paste this key to the Basic Settings page of our facebook application as shown below using the green arrow.

No comments: