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.

Getting info about JWT user

See original GitHub issue

How Can I check information about authorized users? Like username, and others?

I’ve created/copied this code:

from auth0.v3.authentication.token_verifier import TokenVerifier, AsymmetricSignatureVerifier

domain = 'dev-my-id.eu.auth0.com'
client_id = 'https://my-host.com'

id_token = 'my_best_token'

jwks_url = 'https://{}/.well-known/jwks.json'.format(domain)
issuer = 'https://{}/'.format(domain)

sv = AsymmetricSignatureVerifier(jwks_url) 
tv = TokenVerifier(signature_verifier=sv, issuer=issuer, audience=client_id)
tv.verify(id_token)

It works nice, but in the documentation doesn’t exist any example with the real use case of this. I search in the code of the library and I find Users class, but tokenInfo() method is deprecated (why?) and in userInfo JWT token doesn’t work.

Users(domain=domain).tokeninfo(id_token) - 404 error. Users(domain=domain).userinfo(id_token) - 401 error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:34 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
autherealcommented, Aug 12, 2021

Hi I’ve a similar use case as https://github.com/auth0/auth0-PHP/issues/422 and am wondering if a similar approach to the one that the PHP SDK went with can be used: https://github.com/auth0/auth0-PHP/pull/428. Would you accept a PR for this?

1reaction
cledesmacommented, Feb 4, 2021

Hello! Any updates here? I can see that this issue is also present for the PHP token verifier, and the team fixed it here https://github.com/auth0/auth0-PHP/issues/422 https://github.com/auth0/auth0-PHP/pull/428

Are we also fixing it for the Python library? I am having the same issues as @michaldev, and I am only following your documentation

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Web Token Introduction - jwt.io
Information Exchange: JSON Web Tokens are a good way of securely transmitting information between parties. Because JWTs can be signed—for example, using public/ ......
Read more >
node.js - I want to get user information with the json web token ...
node. js - I want to get user information with the json web token assigned to the user - Stack Overflow. Stack Overflow...
Read more >
JWT authentication: Best practices and when to use it
Learn how to best use JWT to trust requests by using signatures, exchanging information between parties, and preventing basic security ...
Read more >
Get Started with JSON Web Tokens - Auth0
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties...
Read more >
How to get an access token with JWT Grant
How to get an access token with JWT Grant · Step 1. Request application consent · Step 2. Create a JWT · Step...
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