2

I am getting Invalid android_key Parameter. The Key cDg3*****ETg does not match any allowed key. Configure your app key hashes at https://developers.facebook.com/apps/2487**2958.

Steps i have completed in my window system 1. keytool -export -alias myAlias -keystore C:\Users\Mayank.android\myKeyStore | C:\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\openssl-0.9.8k_X64\bin\openssl enc -a -e

  1. got hash key wjPx**+Dd+77dtPh8Sm8k=
  2. Facebook app configuration

    1. filled name
    2. package name
    3. class name
    4. hash key wjPx**+Dd+77dtPh8Sm8k=
    5. got app id 2487***2958

what else need to do.

Mayank
  • 47
  • 10
  • Are you using the same signed app to connect to facebook, the application signature has to match the hash key that you have put in. Or Possibly your hash isn't generated correctly - refer to steps here : http://stackoverflow.com/questions/4388992/key-hash-for-android-facebook-app – Ashwini Bhangi Apr 25 '13 at 10:07
  • @AshwiniBhangi I went through your link and modified C:\Users\Mayank\.android>keytool -exportcert -alias androiddebugkey -keystore "C :\Users\Mayank\.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64 this is working and got some funny thing along with this 430228082415Z071♂0 no. is this my hashkey ? – Mayank Apr 25 '13 at 10:26
  • Those characters don't seem right. the characters will be base64 encoded. can you post some log from command prompt ? – Ashwini Bhangi Apr 26 '13 at 20:11

1 Answers1

0

Are you facing the problem when running on Emulator or your Android device? If on Android devices, you could get the HashKey from the piece of code below, which is learnt from https://developers.facebook.com/docs/android/getting-started.

The keytool executed in your windows machine is only for your emulator run on the machine.

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Add code to print out the key hash
try {
    PackageInfo info = getPackageManager().getPackageInfo(
            "com.facebook.samples.hellofacebook", 
            PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}

...

You'll find your hashkey in the Logcat, e.g.

12-20 10:47:37.747: D/KeyHash:(936): 478uEnKQV+fMQT8Dy4AKvHkYibo=
Elye
  • 53,639
  • 54
  • 212
  • 474