Login Failed Invalid Key Error with Facebook Sdk

Login failed invalid key error with Facebook SDK

If the Facebook application is installed on the device, the described error will be raised.

Uninstall the existing Facebook application and run the application; it is working well. This is an SDK problem.

Android invalid key and Facebook Connect

Your key is: "8Ioc4p/jMXoU9Lezug4nzmZfFUg"

Now copy this key and open this URL, and paste this key in the native Android app, marked with a green border.

Enter image description here

Android Facebook SDK 4.5.0 Login-Logout Issue Invalid Key Hash Error, While Trying to Login Again

I was having the same issue, you need to delete app from facebook app and then logout. Following function will do the trick.

public void disconnectFromFacebook() {

if (AccessToken.getCurrentAccessToken() == null) {
return; // already logged out
}

new GraphRequest(AccessToken.getCurrentAccessToken(), "/me/permissions/", null, HttpMethod.DELETE, new GraphRequest
.Callback() {
@Override
public void onCompleted(GraphResponse graphResponse) {

LoginManager.getInstance().logOut();

}
}).executeAsync();
}

Invalid Key Hash using Android Facebook sdk

Look, you generate KEY HASH with debug key ~/.android/debug.keystore
but you need to set here your key which you using for publish on Google Play ~/.android/release.keystore

keytool -exportcert -alias androiddebugkey -keystore ~/.android/folder_with_your_release_key/release.keystore | openssl sha1 -binary | openssl base64

and generated KEY HASH add to facebook developer console

Step by step:
Go to https://developers.facebook.com and open Settings->Basic->Android->Key Hashes and copy paste here you KEY HASH that you generated with keytool, BUT ONLY using you release key, NOT debug (see command above)

Facebook Android SDK Invalid_key

Invalid Key could be for a number of reasons -

  1. Make sure you have Keytool and OpenSSL installed.
  2. Make sure you are giving the correct Keystore file in the command.
  3. Make sure you are giving the correct Alias.
  4. Make sure you copied the generated Hash Key correctly to the Facebook application correctly.

When I got Invalid Key initially, it was because I was giving the wrong Alias. The strange thing is, that Keytool and OpenSSl won't mention that the alias is wrong. If you give the command to generate the Hash Key, and it doen't ask you for your password, you're probably doing it wrong.

Facebook key hash does not match any stored key hashes

After hours of trying I've finally found a solution.

  1. Delete any app on the website of Facebook (developers.facebook.com)
  2. Delete the file debug.keystore under C:\Users\yourUserName\.android
  3. Generate a new key (by running your app again)
  4. Create a new app on developers.facebook.com and add the new hash key
  5. Re-run your app
  6. Succes!

An error's occurred when authenticating with Facebook's android sdk

I also faced this problem. First of all I need to know which Key Hash value you entered on facebook app if it is 'ga0RGNYHvNM5d0SLGQfpQWAPGJ8=' then that is the problem. I think you entered

keytool -exportcert -alias androiddebugkey -keystore
~/.android/debug.keystore | openssl sha1 -binary | openssl base64

this one on the terminal and you entered your own password to generate the key hash. if you done that please try do the following things also you enter the above command on terminal(I am using UBUNTU(linux). You type the command corresponding to which OS you are using) and enter the password as 'android'. This time you will get a different hey hash value. Copy that value and save it as the key hash value for your facebook app. After that check it is working or not. For me it worked. This will occur when we are using the debug key. After all this when you are about to publish this application on the Android market you will have to again change the key hash value according to the private key you are using. Try this may be this will help you.



Related Topics



Leave a reply



Submit