Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add the option to validate the iss and aud claims for JWT logins. #7827

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented Jul 13, 2020

Fixes #7818

This adds two optional fields to the JWT configuration to validate the iss and aud claims of a JWT. There's some more information about these at in the PyJWT docs. Note that the claims are handled slightly differently if the configuration is not provided, iss claims are essentially ignored, but an aud claim will cause validation to fail.

Both are simple strings that are compared by comparison.

This updates the documentation and tests, but also slightly changes error handling for JWT logins to catch any PyJWT errors and convert them to LoginError.

I debated about making a separate JwtHandler, but this didn't end up adding too much code to the login REST servlet.

@clokep clokep requested a review from a team July 13, 2020 14:29
@clokep clokep merged commit 77d2c05 into develop Jul 14, 2020
@clokep clokep deleted the clokep/jwt-improvements branch July 14, 2020 11:16
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit '77d2c0541':
  Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance JWT support to include configurable audience and issuer
2 participants