Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No exposed method to get the user identity from the token #7

Closed
raijinsetsu opened this issue Dec 9, 2016 · 5 comments
Closed

No exposed method to get the user identity from the token #7

raijinsetsu opened this issue Dec 9, 2016 · 5 comments

Comments

@raijinsetsu
Copy link

I've looked in the code and I do not see any way to extract the identity from the id_token without doing it myself. It seems easy enough (base64Decode(id_token.split(',')[1])), but I really think this should be a method of the Client class.

@panva
Copy link
Owner

panva commented Dec 9, 2016

What about having it on the returned tokenset?

@raijinsetsu
Copy link
Author

raijinsetsu commented Dec 9, 2016 via email

@panva
Copy link
Owner

panva commented Dec 9, 2016

Let me explain my thought process,

  • i don't want to provide a method to just decode a token, it should be only for the one's the library has validated
  • i want to avoid unnecessary double verification of tokens, as it can be, in some scenarios, quite an expensive operation
  • i don't want to extend the non-function properties on a tokenset

Making it a method on the tokenset makes sure no serialization that users already have in place will pick up an extra property. Putting it on a tokenset makes it immediately available after authorizationCallback and refresh calls, which is where you possibly want to read it anyway. Other than these cases, if you lose the tokenset entity itself, there's always base64decode ;)

@raijinsetsu
Copy link
Author

raijinsetsu commented Dec 9, 2016 via email

@panva
Copy link
Owner

panva commented Dec 9, 2016

@panva panva closed this as completed Dec 9, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants