How to create key hash in Windows 7 64bit

Recently i tried to get started with Facebook SDK for Android . Actually there is a good tutorials for getting started in facebook developer site. I followed this link
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

I created a sample app in Facebook developer site and added the key hash in App setting . but When started the app i found the Facebook Authentication is working at all.I got

Mobiletest is misconfigured for Facebook login. Press okay to go back to the application without connecting to facebook

If you press okay it will go back to the application. And it will show an error like
Login Failed: invalid_key: android key mismatch. Your key "abcdefghijklmns" Does not match tje allowed keys specified in your application Settings

This is because you have entered a wrong key in Apps settings in https://developers.facebook.com/apps.
After lot of googling i found that the keytool am using giving a wrong key hash. The error is caused by Openssl-for- windows library. Actually i downloaded the latest openssl-for-windows library from Google code. After more searching i found the latest library won't work fine in 64 bit windows. I will list out what i have done.

  1. First download openssl-0.9.8e_X64 (Note it's not the latest version. The latest version when am writing is openssl-0.9.8k_X64).
  2. Extract it . You will found libeay32.dll, ssleay32.dll and openssl.exe in bin folder. Copy it to C:\Windows\SysWOW64 (If it's added to path or Extract it somewhere and give the full path in command). 
  3. Use this comand 
  4. keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64
  5. use the password android 
  6. Copy and paste the 30 character key hash in Facebook
Now it's works fine for me.

Comments

was delighted to find this web site.I wanted to thank you for your time reading this wonderful! I really enjoyed every bit of it and I've marked to ensure that the blog post something new.
Duplication
Promo Disc said…
would like to appreciate your efforts that bring really nice work and also engage all people here to take opportunity for share their views. This is truly nice.
BluRay Disc Duplication
Brown Jason said…
I’m impressed, I have to say. Really not often do I encounter a blog that’s each educative and entertaining, and let me inform you, you could have hit the nail on the head. Your thought is excellent; the issue is something that not sufficient individuals are talking intelligently about. I’m very happy that I stumbled throughout this in my search for one thing referring to this.
Catch a cheater

Popular posts from this blog

Angular4 - primeng, ngx-bootstrap

Configure PostgreSQL and phpPgAdmin in WAMP

MEAN js Application structure

Change Android AVD location in Windows7

Angular 4 - Modules, components and routing