question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

credentials.idToken

See original GitHub issue

Angular: v1.5.6

Firebase: Firebase v3.0.3 Build: 3.0.3-rc.1

AngularFire: AngularFire 2.0.1

    $firebaseAuth().$onAuthStateChanged(function (userObject) {

    });

userObject does provide the provider credentials idToken or the accessToken.

You can verify the idToken with this GET request. https://www.googleapis.com/oauth2/v3/tokeninfo?id_token= https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=

userObject.getToken().then(function(data){}) did not give me googleapis.com compatible token.

The docs state: https://firebase.google.com/docs/auth/web/google-signin

var token = result.credential.accessToken;

I only found result.credential.idToken.

Can we not store these tokens on userObject with the provider data?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
jwngrcommented, May 24, 2017

getToken() (now getIdToken() as of the latest major release) returns a Promise fulfilled with the token:

return user.getIdToken()
  .then(token => {
    console.log("Token:", token);
  })
  .catch(error => {
    console.log("Error getting token:", error);
  });
1reaction
jwngrcommented, Sep 18, 2016

Don’t pass userObject.kd since kd is just the minified name of the variable. You should be able to call getToken() off of your userObject to get an ID token which you can pass to your server. Check out our docs on how to retrieve ID tokens from clients here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sign In Using ID Tokens | Credential Management
An ID token is a signed assertion of a user's identity that also contains a user's basic profile information, possibly including an email...
Read more >
Get an ID token | Authentication - Google Cloud
Use the IAM Credentials API to generate the ID token for the authorized service account. For step-by-step instructions, see Generating OpenID Connect ID...
Read more >
ID Token and Access Token: What Is the Difference? - Auth0
The infographic's example access token shows a token issued by Auth0 with a client ID subject (sub) and client_credentials grant, meaning not only...
Read more >
Create verifiable credentials for ID tokens - Microsoft Entra
Learn how to use a quickstart to create custom credentials for ID tokens. ... Create a custom credential with the idTokens attestation type ......
Read more >
google.oauth2.id_token module - google-auth - Read the Docs
To parse and verify an ID Token issued by Google's OAuth 2.0 authorization server use ... then ID token is acquired using this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found