دنبال کننده ها

۱۳۹۶ اسفند ۲۸, دوشنبه

unable to signinWithCredential() for facebook Oauth with Firebase

[ad_1]



I've been unable to successfully use firebases signinWithCredentials() for a facebook login. I've checked and rechecked that i'm using the correct app_id and app_secret on firebase's authentication page as well as confirmed my settings and added a redirect uri to facebooks dev console.



I'm using a react-native application built on top of expo. My auth flow is to use expo to display the facebook UI and sign the user in.



const type, token = await 
Facebook.logInWithReadPermissionsAsync('a_secret_number',
permissions: ['public_profile', 'email']
);


This successfully returns a token which I then try to integrate with firebase by creating a credential:



const credential = await 
firebase.auth.FacebookAuthProvider.credential(token);


the credential looks something like:




"accessToken": "EAAIgv4Sw9TQBAA1G30ZC71qyjcRLM4o9kWVxf1oGhZAWAdGVeZBHrSdNADHGxCeZCzyWxZAjEPM1iZCXXdsadsadsaga321432432dsaddsadsadas34214234324asdasdsadsapv1W3ybqtziQC4JRKZA5hD4a50JrVC1rfoFiFZAJZCcoGoRViTQtgevbnNEx8s7ZA1a1Xd6xOQBsnZC1qdJzOTgZDZD",
"providerId": "facebook.com",



So, up until now i've confirmed the data is formatted correctly and contains something to send to firebase.



Finally,



try 
await firebase.auth().signInWithCredential(credential);
catch (error)
console.log(error);



And the error message:



"error":"errors":["domain":"global","reason":"invalid","message":"Unsuccessful debug_token response from Facebook: "error":"message":"(#100) The App_id in the input_token did not match the Viewing App","type":"OAuthException","code":100,"fbtrace_id":"EpP6p3IVs3a""],"code":400,"message":"Unsuccessful debug_token response from Facebook: "error":"message":"(#100) The App_id in the input_token did not match the Viewing App","type":"OAuthException","code":100,"fbtrace_id":"EpP6p3IVs3a""


After Several hours of headbanging and trying to find solutions for this error, i've come to stack overflow for help. Any help or guidance would be appreciated :)



Module Versions:
"expo": "23.0.0",
"firebase": "^4.10.0",




[ad_2]

لینک منبع