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

Feature: Allow options for verification and requirement of azp #309

Open
redbmk opened this issue Jan 18, 2023 · 1 comment
Open

Feature: Allow options for verification and requirement of azp #309

redbmk opened this issue Jan 18, 2023 · 1 comment

Comments

@redbmk
Copy link

redbmk commented Jan 18, 2023

Could we add an option to verify azp (Authorized party - the party to which the ID Token was issued)? For example:

jwt.decode(
  token,
  key,
  azp="asdf1234",
  options: {"require_azp": True},
)
@redbmk
Copy link
Author

redbmk commented Jan 18, 2023

Current workaround would simply be something like this:

claims = jwt.decode(...)
if "azp" not in claims:
    raise JWTError("Expected azp to be in claims")
elif calims["azp"] != expected_azp
    raise JWTError("Invalid authorized party")

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