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.

Read access_token from logged in user

See original GitHub issue

How can I from a controller get the tokens for the authorized user? I have tried something like this but the token list is seems to be empty.

var userResult = await HttpContext.AuthenticateAsync();
var user = userResult.Principal;
var tokens = userResult.Properties.GetTokens().Select(token => new string[] { token.Name, token.Value });

Is this the correct way to get hold of the tokens?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
HaoKcommented, Jan 9, 2020

Thanks @guardrex

closing this issue @marcuslindblom feel free to use the docs issue for any further discussion

0reactions
guardrexcommented, Jan 9, 2020

I’ll open an issue to take a look at this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JWT Auth, Way to access AccessToken when you logged in
When i sucess logged in with correct user information, AccessToken and Refresh Tokens are issued. I needed a code to access to Access...
Read more >
Get Access Tokens
Learn how to request Access Tokens using the Authorize endpoint when authenticating users and include the target audience and scope of access requested...
Read more >
Get User info from his access_token
In your req.user example, looks like you have a token from a client credentials grant flow from your Auth0 Management API. That token...
Read more >
Get access on behalf of a user - Microsoft Graph
Learn how an app obtains an access token from the Microsoft identity platform and calls Microsoft Graph on behalf of a user.
Read more >
Logging in and Using an Access Token - Kii Documentation
A user will get their access token from Kii Cloud when they sign up or sign in. The access token is s string...
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