Jul 16, 2012 0
Facebook android sdk, invalid_key & key store alias
If you are getting this error ‘invalid_key: Android key mismatch. Your key “xxxxxxxxxxxxxx” does not match the allowed keys specified in your application settings’ then it clearly means that there is something wrong either with the key you generated or the key you have listed in facebook application page.
Although, the error description is very clear and straight forward but it took me some good amount of time to discover the actual cause. In my case, I was using wrong key store alias for generating the key, resulting in key mismatch when application is executed. So if you also have forgotten the key alias then there this command which returns details of a key in key store:
C:\Users\Waqas>keytool -list -v -keystore c:\path-to-keystore\key.store
enter the password if required and if all goes well you get’ll something like this:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: sample-app
Creation date: May 13, 2012
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Waqas Hussain Siddiqui, C=PK
Issuer: CN=Waqas Hussain Siddiqui, C=PK
Serial number: 4faf9730
Valid from: Sun May 13 16:12:48 PKT 2012 until: Tue May 06 16:12:48 PKT 2042
Certificate fingerprints:
MD5: 00:00:00:00:00:00:00:76:52:27:42:D3:72:96:84
SHA1: BA:BA:EF:XX:XX:XX:8B:0A:94:1D:E7:XX:B5:72:AA:59:88:XX:F7:XX
Signature algorithm name: SHA1withRSA
Version: 3
*******************************************
*******************************************

Recent Comments