fullstackreact/react-native-firestack

firestack.auth.signInWithProvider doesn't work with twitter

SvetlanaPrudnikova opened this issue · 3 comments

Hi, I'm trying to make auth via twitter using react-native-oauth. My twitter login function is bellow:

  twitterLogin = () => {
    this.manager.authorize('twitter', {})
      .then(response => {
        const {accessToken, consumerKey } = resp.response.credentials;
        console.log('Your users ID', response, accessToken, consumerKey);
        this.firestack.auth.signInWithProvider('twitter', accessToken, consumerKey)
          .then((user)=>{
            console.log(user)
          })
          .catch(err => console.log('There was a firestack error', err));
      })
      .catch(err => console.log('There was an error', err));
  };

I receive response in my console from manager.authorize() as following:

response:Object
  credentials:Object
       accessToken:"832503184249716737-tTxGM5uPXynHP2B9dB8cNCN3BRA3yGE"
       consumerKey:"WdngTlXwxbc1Nyp0d2cOaKzDv"
       type:"Bearer"
  __proto__:Object
  uuid:"832503184249716737"

And then I receive error from this.firestack.auth.signInWithProvider:

Object:
   allErrorMessage: "com.google.firebase.FirebaseException: An internal error has occurred. [ Fail   to get successful verify_credentials response from Twitter: {"errors": [{"code":32,"message":"Could not authenticate you."}]} ]"
   errorMessage: "An internal error has occurred. [ Fail to get successful verify_credentials response from Twitter: {"errors":[{"code":32,"message":"Could not authenticate you."}]} ]"
  __proto__:Object

What can be the reason of these error?

Thank you!

@SvetlanaPrudnikova Did you figure this out? I seem to have the same issue.

Guys, i am facing the same issue
error message: com.google.firebase.FirebaseException: An internal error has occurred [ No TWITTER config found ]

did you get a solution for this? @SvetlanaPrudnikova @holgersindbaek @Danny2790