Retrieve UPN from Bearer Token
Issue #442
resolved
Hi,
Is there a way in the library to retrieve the UPN from the Bearer token claims? When I decode the Bearer token, there are many claims available like upn, prefered_name etc. Is there a way to retrieve those?
Thanks,
Rubini
Comments (2)
-
-
- changed status to resolved
- Log in to comment
Yes.
If the token is opaque or the Authorization server supports introspection:
https://connect2id.com/products/nimbus-oauth-openid-connect-sdk/examples/oauth/token-introspection
If the token is a signed JWT - use the Nimbus JOSE+JWT lib:
https://connect2id.com/products/nimbus-jose-jwt/examples/validating-jwt-access-tokens