Today I am going to start my first post on Codepedia.info
This article explains how to generate `Android key hash` for FACEBOOK App and LINKEDIN App as in Login Authentication i.e. Facebook SDK integration to android require an key hash configuration same for LinkedIn App.
Android key hash facebook
So Are you working on Social Login ? From Android to LinkedIn App or Android to Facebook App? Whichever it may be you will need an android hash key facebook and package name to login using social elements.
I hope you all are familiar with android studio or eclipse and required java and SDK required to run an android application.
Let us start with the steps
Now what is keytools and where will you get it in your system.
- Go to your `keytools` directory using command prompt.
What is Java Keytool ?
Java Keytool is a key and certificate management utility. It allows users to manage their own public/private key pairs and certificates. It also allows users to cache certificates.
Java Keytool stores the keys and certificates in what is called a Keystore. By default, the Java Keystore is implemented as a file.
It protects private keys with a password. A Keytool Keystore contains the private key and any certificates necessary
to complete a chain of trust and establish the trustworthiness of the primary certificate.
Where will you get or what is its directory?-
folder is in C:/Program Files/
then move inside that folder to jre6
and then move to bin folder. To make things more clear i will post a image/screenshot of it.
- Go to this directory and then enter the following command
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\User\.android\debug.keystore" | openssl sha1 -binary | openssl base64
Now after you enter the above code you may get the following error
openssl is not recognized as an internal or external command
Below screenshot will make things more clear
Now this error may be because of two things
- OPENSSL path may be different.
- OPENSSL may not have been installed in your system.
For first error the solution is to change the path of OpenSSL for eg
and for second error the solution is you can download the
To download OPENSSL
OpenSSL for 32bits
OpenSSL for 64bits
After you have downloaded the zip file. Just extract the file to you required path. Preferably (program files
) for eg.
- After this, you need to tweak the previous command in the command prompt a bit.
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\User\.android\debug.keystore" | "C:\Program Files\openssl\bin\openssl" sha1 -binary | "C:\Program Files\openssl\bin\openssl" base64
If you have saved the `OpenSSL` folder in example path
- Then you will be asked for password
as password then you will get the hash key. And then use the hash key wherever you need.
Hope you enjoyed this tutorial. If you have any recommendations, please let us know what you think in the comment section below! See you again next time!
If You Liked It, could you do me a favour and tell your friends !! By sharing it on Facebook, Google+, Twitter.