react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

signInWithProvider for Google is not working (using react-native-oauth for cred.)

Open ajonno opened this issue 9 years ago • 17 comments

I'm using react-native-oauth to authenticate with Google and have it return the payload which contains an access_token. That is working fine.

I am then using the access_token, to try and authenticate with Firebase, using Firestack.

Here is the call:

const configurationOptions = {
   debug: true,
   clientID: 'xxxxxxxx-0ufhn1bvnyqq92id0m.appsyyyyyyy.googleusercontent.com'
};
const firestack = new Firestack(configurationOptions);

firestack.signInWithProvider('google', resp.response.credentials.access_token, '') //.
.then((user)=>{
   this.props.navigator.push(Router.getRoute('homeView', {showText: true}));
})
.catch(err => {
   console.log(err)
});

this is the error Firebase is sending back:

{error: "No user signed in", description: "An internal error has occurred, print and inspect the error details for more information."}

Given that the react-native-oauth callback succeeds and returns me a payload, shouldn't the access_token to then authenticate to Firestack therefore work ?

ajonno avatar Nov 26 '16 11:11 ajonno

Just for clarification, what platform are you working on?

auser avatar Nov 26 '16 23:11 auser

this is iOS only

ajonno avatar Nov 26 '16 23:11 ajonno

I'll check it over here after I finish google auth support in react-native-oauth on Android

auser avatar Nov 26 '16 23:11 auser

txs mate much appreciated

ajonno avatar Nov 26 '16 23:11 ajonno

Okay, I checked it out here. Are you working on the master branch?

auser avatar Nov 27 '16 06:11 auser

Yes I had installed from master branch

ajonno avatar Nov 27 '16 06:11 ajonno

Okay, cool... did you enable it in Firebase?

auser avatar Nov 27 '16 06:11 auser

Feel free to jump in the gitter room for more real-time debugging: https://gitter.im/fullstackreact/react-native-firestack

auser avatar Nov 27 '16 06:11 auser

@ajonno Are you passing access_token or idToken. Firebase expects idToken for google auth

chaitanya-bhagavan avatar Nov 28 '16 18:11 chaitanya-bhagavan

@ajonno did you get this fixed?

auser avatar Dec 01 '16 00:12 auser

Hey Ari - unfortunately no, I had to move on to other tasks the day after we caught up. I'm going to take another look this weekend, hopefully to get it sorted. Will let you know.

On 1 Dec 2016 11:11 AM, "Ari" [email protected] wrote:

@ajonno https://github.com/ajonno did you get this fixed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fullstackreact/react-native-firestack/issues/168#issuecomment-264038340, or mute the thread https://github.com/notifications/unsubscribe-auth/AC3bVdoT5HuHCh2p-voK7tzBpwXeeWn-ks5rDhC0gaJpZM4K832A .

ajonno avatar Dec 01 '16 05:12 ajonno

Any updates on this? Not working for me on react-native 0.40. All other providers work.

birkir avatar Jan 25 '17 15:01 birkir

We had to park this and keep the app build moving. Funny enough I came back to this a few days ago to see if latest version worked with Google auth, but I couldn't get it going either. Like you we are still very keen to resolve.

ajonno avatar Jan 26 '17 00:01 ajonno

Holla @ajonno and @birkir -- Does gauth work for you on rn-oauth or is it integration with firestack?

auser avatar Jan 26 '17 00:01 auser

yes sorry i did mean to add we were trying via rn-oauth

ajonno avatar Jan 26 '17 00:01 ajonno

I've seen some success with the google-signin component, yet to try it.

birkir avatar Feb 13 '17 00:02 birkir

Getting this same error right now. iOS Only using react-native-google-signin. Odd thing is it was working before...

alexkendall avatar Mar 10 '17 16:03 alexkendall