Skip to content Skip to sidebar Skip to footer

Login Error There Is an Error in Logging You Into This Application Please Try Again Later

Photograph by Elisa Ventur on Unsplash

Hello guys, you might be facing this error "Login Fault: there is an fault in logging you into this application" when running your app in a production environment. (If you are facing any issue in development manner brand certain to checkout App setup here) This error ONLY happens when users have the Facebook app installed, so just in instance, if you lot don't face any issue on your device, brand certain to verify with the Facebook app installed also.

Background Information:

I've been using Facebook login with react-native and information technology was working perfectly on the development build, later when I released the app when the user clicks the Facebook login button, it shows an error similar below.

Facebook login error

And so in that location are 2 solutions for this. The starting time approach is easier but not an ACTUAL solution though and I would not encourage you to use that, just allow'southward cheque both methods.

First method: (Not recommended, as it might ask the user to enter a password)

When you are making a sign-in request like this:

          wait LoginManager.logInWithPermissions(["public_profile", "electronic mail"])        

Just before this make sure to add the following code:

          if (Platform.OS === "android") {
LoginManager.setLoginBehavior("web_only")
}

await LoginManager.logInWithPermissions(["public_profile", "e-mail"])

This fashion, the Facebook login will employ the browser to get the user logged in, so there are chances that users will be prompted to enter the countersign again, as not anybody keeps their social accounts logged in a browser. That'south it, this will brand it work, but more abrasive to users in-app experience.

2d Method: Recommended (Add app signing cardinal hash to your Facebook programmer console)

First of all, allow's but understand what we need to practise here. As you lot might know, when setting upwardly the Facebook app on the developer console you might have seen the field "Primal Hashes". Let's first understand what fundamental hash is and why they are required.

What are primal hashes?

Key hashes are 28 characters including the abaft = and are limited to the post-obit characters: [a-zA-Z0–ix+/=]

Why key hashes are required?

So whenever any login request is initiated from your application Facebook uses the key hash to cosign interactions between your app and the Facebook app. And then if your key hashes are not added it will not allow LoginManager to go along further, and keep it equally unauthorized access.

How to fix it?

To set this issue, Make sure you lot already uploaded your app to the play store and enabled "app signing by Google Play".

  • Login into your Play Console account
  • Click on the app with which yous are facing an outcome
  • Now from the left sidebar go to Setup => App Signing, where y'all volition encounter something like this

App signing key certificate
  • Under "App signing document" copy the SHA-1 certificate fingerprint
  • Now convert your SHA-1 to a valid primal hash using any of these methods.

Method 1: Online Tool.

  • Open this online tool to catechumen information technology to a valid primal hash.
  • Paste the SHA-1 in the showtime field
  • Copy the text from Output (base64)

Method two: Control line

  • If you lot practice not want to utilise the online tool to protect your SHA-i, y'all can use this command, while executing information technology, make sure to replace PASTE_YOUR_SHA1_HERE with your SHA-1.
          node -e 'panel.log(Buffer.from(process.argv[one].split(":").map(hex => parseInt(hex, sixteen))).toString("base64"))' 'PASTE_YOUR_SHA1_HERE'        
  • It will impress your SHA-1 in the console, and y'all tin copy information technology from in that location.

Once you have Key Hash generated:

  • Go to developer.facebook.com/apps
  • Open your app and from the left sidebar go to "Settings" -> "Basic".
  • Scroll down below where you see Key Hashes, and paste the copied Output (base64) here & Save Changes.
  • That's it.

I've only tried this with Google Signed Awarding. If you are signing your application by yourself, this method might not work, but you can try converting your SHA-1 certificate fingerprint to base64 and paste that into key hashes. If this works, experience costless to add together a comment below so that it tin can help other people besides.

Cheers for reading, Follow me for more stuff related to Full-stack development. Happy coding, Stay safe!

More content at plainenglish.io

dickinsonhumpeatered.blogspot.com

Source: https://javascript.plainenglish.io/fix-login-error-there-is-an-error-in-logging-you-into-this-application-on-facebook-login-with-237e3baba116

Post a Comment for "Login Error There Is an Error in Logging You Into This Application Please Try Again Later"