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

Allow passing claims_options in StarletteOAuth2App #446

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

Galaxy102
Copy link
Contributor

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

  • You consent that the copyright of your pull request source code belongs to Authlib's author.

This pull requests allows to put custom claims_options into the StarletteOAuth2App. This is needed for example in a multihomed Keycloak setup. Here, the users accesses Keycloak from a public URL (e.g. https://keycloak.localhost with a Reverse Proxy in front) which might not be reachable from the application (e.g. in a Docker Container). In that case, the program using authlib would access Keycloak directly using a private URL (e.g. http://keycloak:8080).
Here, the JWT iss would mismatch when retrieving the user_info, but the developer knows that it has two possible values: The public and the private URL. To suppress the validation error, the base function AsyncOpenIDMixin.parse_id_token allows setting custom claims_options, but in StarletteOAuth2App, that was impossible to do.

@lepture
Copy link
Owner

lepture commented Apr 5, 2022

Could you also add it for Django and Flask? I would like to keep them the same API.

@Galaxy102
Copy link
Contributor Author

Done

@lepture lepture merged commit 098bb16 into lepture:master Apr 12, 2022
@lepture
Copy link
Owner

lepture commented Apr 12, 2022

Thanks

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

Successfully merging this pull request may close these issues.

2 participants