Programmers learn & share
0 votes
577 views

Problem :

I am getting following error
login error: there is an error in logging you into this application. please try again later.
by (6.9k points)   | 577 views

2 Answers

0 votes

Solution :

The error your facing because of invalid hash key.

You can create the Hash key using the following command and after that you need to update the same at https://developers.facebook.com/ under Settings-> Basic -> Android HashKeys

e.g.
keytool -exportcert -alias ADD_RELEASE_KEY_ALIASE_HERE -keystore ADD_UR_KEYSTORE_PATH_HERE | openssl sha1 -binary | openssl base64

Now you can find the Release Keys Alias of your keystore using the following command:

keytool -list -keystore ADD_UR_KEYSTORE_PATH_HERE

I have also experienced the issue by using the above HashKey the login works fine if I have installed the release APK directly to the device, But if I upload the APK to Play Store and after that try to install the app from store then it shows the same Login failed error as shown earlier. The solution for this issue is as follows:

  1. Go to Release Management at https://play.google.com/apps/publish/signup/
  2. Please select Release Management
 -> App Signing
  3. Now you can see the SHA1 key in hex format App signing certificate.

  4. Copy the SHA1 in the hex format and convert it in to the base64 format now you can use this http://tomeko.net/online_tools/hex_to_base64.php to do that without the SHA1: part of the hex.

  5. Finally go to Facebook developer console and add the key(after convert to base 64) in the settings —> basic –> key hashes.
And your issue is resolved.
by (36.1k points)  
0 votes

Solution:

The error occurs because of invalid hash key.

We can create Hash key using the below command and update the same here under Settings-> Basic -> Android HashKeys

keytool -exportcert -alias ADD_RELEASE_KEY_ALIASE_HERE -keystore ADD_UR_KEYSTORE_PATH_HERE | openssl sha1 -binary | openssl base64

You can find the Relase Key Alias of your keystore using the below command if needed:

keytool -list -keystore ADD_UR_KEYSTORE_PATH_HERE

I have also experience an issue like by using the above HashKey the login works fine if I install the release APK directly to the device, But when I upload the APK to Play Store and install app from store then it shows the same Login failed error. The fix for this is as follows:

  1. Go to Release Management here

  2. Select Release Management
 -> App Signing

  3. You can see SHA1 key in hex format App signing certificate.


  4. Copy the SHA1 in hex format and convert it in to base64 format, you can use this link do that without the SHA1: part of the hex.


  5. Go to Facebook developer console and add the key(after convert to base 64) in the settings —> basic –> key hashes.

Just throwing this out there for people still experiencing this issue. The hash I created through the keytool was somehow incorrect. I fixed it by doing the following:

If you already uploaded your app to the playstore and enabled "app signing by Google Play" there is a solution (at least this worked for me):

  1. login into you play console

  2. click on the app

  3. now on the left side click "release management"

  4. click "App signing"

  5. under "App signing certificate" copy the SHA-1 certificate fingerprint

  6. go to http://tomeko.net/online_tools/hex_to_base64.php

  7. paste the SHA-1 in the first field

  8. copy the text in input field under "Output (base64)"

  9. now open developer.facebook.com/apps

  10. click your app

  11. on the left side navigate to "Settings" -> "Basic"

  12. past the Base64 text here under key hashes

UPDATE

The steps above should still fully work.

But if you do not want to paste your key on that website, here is an alternative to step 6,7,8 below:

here's a oneliner Node.js command to do the same:

node -e 'console.log(Buffer.from(process.argv[1].split(":").map(hex => parseInt(hex, 16))).toString("base64"))' '5E:8F:16:06:2E:A3:CD:2C:4A:0D:54:78:76:BA:A6:F3:8C:AB:F6:25'

 

ago by (12.8k points)  
2,245 questions
2,807 answers
60 comments
241 users