Firebase Error - Invalid Idp Response: access_token is invalid

4,571 views
Skip to first unread message

Steven Beaulieu

unread,
Mar 21, 2017, 4:28:23 PM3/21/17
to Firebase Google Group
Hi there, I am working with Amazon's Alexa Skills kit and attempting to use a linked Google Account to then authenticate a user in Firebase. I have the account linking completed and an access token is being sent to my Lambda function properly. However, when I pass that access token into the "" method and attempt to authenticate, Firebase returns this error. I cannot find anything meaningful to debug or change that would change this outcome...

Firebase Auth Error: { [Error: {"error":{"errors":[{"domain":"global","reason":"invalid","message":"Invalid Idp Response: access_token is invalid"}],"code":400,"message":"Invalid Idp Response: access_token is invalid"}}]


This is the code used to re-authenticate using the provided access token (via Lambda / Node.js):

// ...
var access_token = this.event.session.user.accessToken;


// ...

var provider = new firebase.auth.GoogleAuthProvider();

// Build Firebase credential with the Google ID token.
var credential = provider.credential(null, access_token);

// Sign in with credential from the Google user.
firebase
.auth().signInWithCredential(credential)
.then(function(result) {
 
// ...
})
.catch(function(error) {
  console
.log("Firebase Auth Error: ", error);
 
// ...
});

The most interesting bit is the fact that even though I get an error response, the user is still showing up in my console as though they properly authenticated...



Any insight would be appreciated... Thank you

Kato Richardson

unread,
Mar 22, 2017, 1:33:51 PM3/22/17
to Firebase Google Group
Hi Steven,

An entry in the console just means that a unique Firebase ID was assigned to that OAuth identity. It doesn't mean they authenticated in any way.

No idea why it's invalid, and just assuming you're specifying the right token--how did you verify that? Could it be expiring?

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/726249f1-7a7b-4978-9536-0a43194e6054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Bassam

unread,
Mar 22, 2017, 2:51:44 PM3/22/17
to Firebase Google Group
Hey Steven, the access token you are using may have been generated by a different Google OAuth client project than the project you are using for the Firebase application.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/726249f1-7a7b-4978-9536-0a43194e6054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages