Login Info Endpoint: optimize OAuth IdPs for JSON Response #3254
+159
−129
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.
(alternative for #3251)
This PR optimizes the login info endpoint so that it does not fetch all OAuth IdPs when a JSON response is requested.
Prior to the optimization, all OAuth IdPs are queried and then used for determining a potential redirect to the corresponding external IdP. However, for JSON responses the redirect is ignored anyway.
The optimization introduces the following changes to the JSON response, which are in our opinion acceptable:
showLoginLinks
is no longer returned if there is also no SAML IdP withshowSamlLink
enabledidpDefinitions
anywaypasscode
prompt is no longer removed if there is no SAML/OIDC IdP withshowSamlLink
/showLinkText
in the IdP definitions listThe first few commits in this PR are refactorings of the endpoint handler, they don't change any behavior. We advise to go through the PR from commit to commit.