Android Question Facebook Authentication - Invalid Key Hash Message After Months working Ok

virpalacios

Active Member
Licensed User
Longtime User
Hi All, thanks first for your helpfull comments.

I already have the Facebook Sample Demo Working for Month, but I decided to me a routine check and I got the message in my Android App, Invalidid key hash. The key hash LEDPb4QW5Uu6JPK4UfQI11Ad64d= dones not match any stored key hashes. Configure your app key hashes at http://developers.facebook.com/apps/326266266262

I already check the key hash, used key to generate from my private key (I got the same hash), the app address in facebook is ok

I am using B4A 11.20
Facebook lib 1.02

Againg, it was working ok for months, but now we got this message

Thanks for any comments or if anyone has the same issue.
 

virpalacios

Active Member
Licensed User
Longtime User

Facebook Authentication - Invalid Key Hash Message After Months working Ok (Solved)​

Hi all, Good Night everyone,
After frustrating hours trying to understand this issue finally I got this working, this is my situation, so please check your development environment first.

1) I started my project in a diferent machine at 2020 and I migrated to a diferent computer in 2021, everything went fine with facebook, (My hash key was generated in my first computer and placed in facebook developer page).

2) I copied my private key from first computer to second computer and imported it, everything still fine for all 2021,

3) Yesterday I tried facebook login (usually I use google login and most of our customers do)

4) After Login using Facebook, I received a message stating that my hash key is wrong. I went to my first computing I generated the hash hey , it still generating the same number that I have in Facebook App page.

5) I tried copying the hash key from a message, however It still sending a error message!

6) After some reading I got a website for generating a hash key from your SHA1 value in your private key store (B4A-Tools-Private Key Signature) , just the SHA1,
this is the website: http://tomeko.net/online_tools/hex_to_base64.php ,
you only need to paste the SHA1 value and you get the Hash Key, there is not need for downloading openssl.

7) In this case the hash key was the same that facebook message state, so I remove the old one in facebook developer app (inside my app), save it and tried, however I got the same error.

8) In facebook develper I have to put My App from Development to Active.

9) After this , I tried and evething went fine.

Final Words

* I don't understand why I was working from months, and it never noticed I am using apps generated from a different machine
* I don't understand why I am using my same private_key file, it game me a diferent hash number
* And finally, I have to put my app in Active Mode

I hope these words can help anyone with a similar issue

Best Regards

Virgilio from Panama
 
Upvote 0
Top