Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login Error: There is an error in logging you into this application. Please try again later

I am getting this error. When I try to sign in with facebook to my app. When I first time authentication it will correctly working. After I unistalled my application and now trying to sign in with Facebook on that I am getting this error.

Another Issue : After authenticate in device1 and try to login with facebook on device2 also same error is getting.

Solution I Found : when I remove App authentication from Facebook App Settings it is working in above scenario's but this is not an good solution how we can tell to users to do this action?

btnFbLogin.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 if(accessToken != null) {                     boolean expires = accessToken.isExpired();                     if(!expires) {                         performFbLoginOrSignUp(accessToken);                     }                 } else {                     LoginButton loginButton = (LoginButton) findViewById(R.id.login_button);                     callbackManager = CallbackManager.Factory.create();                      if (loginButton != null) {                         loginButton.setReadPermissions("public_profile", "email", "user_friends");                          if (CommonUtil.isConnectingToInternet(LoginActivity.this)) {                             loginButton.performClick();                              loginButton.setPressed(true);                              loginButton.invalidate();                              loginButton.registerCallback(callbackManager, mCallBack);                              loginButton.setPressed(false);                              loginButton.invalidate();                         }                      }                 }             }         }); 

Error page

In Facebook example also having an issue : GitHub link of Facebook example

Steps to reproduce :

  1. Launch the app Login with Facebook Authenticate FB profile.

  2. Un_install the app and install again.

  3. Now try to Login with Facebook.

  4. The above error will occur. because we already authenticated so need to access fb profile. but here we facing the issue.
  5. Here already authenticated page is not showing.
  6. I am using Native FB app with the device Xiaomi Redmi Note 3
like image 447
Naveen Kumar M Avatar asked Aug 20 '16 07:08

Naveen Kumar M


People also ask

Why does my Facebook app keep saying login error?

If you're having trouble logging into your Facebook account from your Facebook app: Make sure that you have the latest version of the Facebook app, or delete the app and then reinstall it. Try logging in from a mobile browser (example: Safari, Chrome).

Why is there a login error on Instagram?

Change your password or send yourself a password reset email. Turn on two-factor authentication for additional security. Confirm your phone number and email address in account settings are correct. Check Accounts Center and remove any linked accounts you don't recognize.


2 Answers

ANSWER

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 the Google Play Console
  2. Click on the app you want the hash from
  3. Now, open the navigation on the left hand side
  4. Under Release click Setup > App integrity Navigation drawer in the Google Play Console
  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. Navigate to the dashboard of your app (My Apps > Your App Name)
  11. On the left side navigate to Settings > Basic
  12. Paste the Base64 text here under Key Hashes enter image description here

That should fix the issue.


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' 

credits: mifi


like image 34
Tafel Avatar answered Oct 07 '22 18:10

Tafel


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

like image 168
MouzmiSadiq Avatar answered Oct 07 '22 17:10

MouzmiSadiq