Strip 'iss' query param from the redirect URL for Keycloak auth flow #3859
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.
What this PR does / why we need it:
Since version 23 Keycloak (RHBK) adds a
iss
query parameter to the authentication response, see https://www.keycloak.org/docs/latest/upgrading/index.html#migrating-to-23-0-0The result of this is that 3scale client included this
iss
value to theredirect_uri
when fetching the access token, which in its turn caused an error:This PR only removes the
iss
from the redirect URI when forming the access token request. Ideally, we would need to also verify the value of theiss
parameter to make sure it is exactly the same as the Realm URL specified in the SSO configuration. See 2.4. Validating the Issuer Identifier in RFC 9207.Which issue(s) this PR fixes
https://issues.redhat.com/browse/THREESCALE-11200
Verification steps
Set up a client for dev portal authentication in RHBK v24 and configure dev portal SSO.
Test the integration and verify it's successful even when the compatibility mode "Exclude Issuer From Authentication Response" is OFF.
Special notes for your reviewer: