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

Decoding JWT #49

Open
akcode47 opened this issue Apr 24, 2023 · 0 comments
Open

Decoding JWT #49

akcode47 opened this issue Apr 24, 2023 · 0 comments

Comments

@akcode47
Copy link

akcode47 commented Apr 24, 2023

This is not an issue but a suggestion for decoding a JWT (hopefully, it helps):

The readme example shows how to use AccessTokenVerifier to validate an access token. However, if you want to use the claims/sub information within the payload for further user verification, you must decode the JWT.

To decode, you don't need to add PyJWT - the library has a built-in parser leveraging python-jose. To use it, import the following:

from okta_jwt_verifier import AccessTokenVerifier, JWTUtils
....
try:
    await jwt_verifier.verify(access_token)
    headers, claims, signing_input, signature = JWTUtils.parse_token(access_token)
    # claims will be a dictionary that contains information like the 'sub' key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant