Ensure OAuth falls back to OpenID userinfo if id_token is not sufficient #5939
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before refactoring the OAuth handlers we would always either obtain our user info via the id_token OR via the OpenID userinfo endpoint. After the refactor we ended up skipping the request to the userinfo endpoint if a valid
id_token
was returned by the token endpoint. However in many cases thatid_token
does not return all the info needed to verify the user. Therefore we now check whether theid_token
contains the required user key and if it doesn't we fall back to making the request to the userinfo endpoint.Fixes #5897