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

Photo past Elisa Ventur on Unsplash

Hello guys, you might be facing this error "Login Error: there is an error in logging you lot into this application" when running your app in a product environment. (If you are facing any issue in evolution style make sure to checkout App setup here) This error Only happens when users have the Facebook app installed, so merely in example, if you don't face any issue on your device, brand sure to verify with the Facebook app installed likewise.

Groundwork Data:

I've been using Facebook login with react-native and it 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 like below.

Facebook login error

And then there are two solutions for this. The first arroyo is easier just not an ACTUAL solution though and I would not encourage you lot to use that, only let's bank check both methods.

Starting time method: (Non recommended, every bit it might ask the user to enter a password)

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

          wait LoginManager.logInWithPermissions(["public_profile", "email"])        

Just before this brand sure to add the following code:

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

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

This way, the Facebook login will utilize the browser to get the user logged in, and then in that location are chances that users will be prompted to enter the password again, as non everyone keeps their social accounts logged in a browser. That's it, this will make it work, but more than annoying to users in-app experience.

2d Method: Recommended (Add app signing key hash to your Facebook developer console)

First of all, let's simply empathise what we need to do hither. As yous might know, when setting up the Facebook app on the programmer console you might take seen the field "Key Hashes". Permit'south first empathize what key hash is and why they are required.

What are key hashes?

Key hashes are 28 characters including the trailing = and are limited to the following characters: [a-zA-Z0–nine+/=]

Why key hashes are required?

And so whenever any login request is initiated from your application Facebook uses the key hash to authenticate interactions between your app and the Facebook app. And then if your key hashes are non added it will not allow LoginManager to proceed further, and go along information technology as unauthorized access.

How to fix it?

To gear up this issue, Make sure you already uploaded your app to the play store and enabled "app signing past Google Play".

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

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

Method i: Online Tool.

  • Open this online tool to convert information technology to a valid key hash.
  • Paste the SHA-i in the first field
  • Re-create the text from Output (base64)

Method 2: Control line

  • If you do not want to use the online tool to protect your SHA-1, you can use this control, while executing it, brand sure to replace PASTE_YOUR_SHA1_HERE with your SHA-ane.
          node -e 'console.log(Buffer.from(process.argv[ane].split(":").map(hex => parseInt(hex, 16))).toString("base64"))' 'PASTE_YOUR_SHA1_HERE'        
  • It will print your SHA-1 in the panel, and you can copy it from there.

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 y'all see Central Hashes, and paste the copied Output (base64) here & Salve Changes.
  • That's it.

I've just tried this with Google Signed Awarding. If y'all are signing your awarding by yourself, this method might not piece of work, but you can endeavor converting your SHA-one certificate fingerprint to base64 and paste that into central hashes. If this works, feel free to add a annotate below and then that information technology tin assist other people besides.

Thanks for reading, Follow me for more stuff related to Full-stack evolution. Happy coding, Stay rubber!

More content at plainenglish.io

paulyousely.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

0 Response to "Login Error There Is an Error Loggin You Into This Application Please Try Again Later"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel