8000 Fix lowerCaseHostname to lower-case scheme and host properly by rmartinc · Pull Request #24819 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Fix lowerCaseHostname to lower-case scheme and host properly - #24819

Merged
mposolda merged 1 commit into
keycloak:mainfrom
rmartinc:issue-24792
Nov 20, 2023
Merged

mposolda merged 1 commit into
keycloak:mainfrom
rmartinc:issue-24792

Conversation

@rmartinc
@rmartinc rmartinc commented Nov 17, 2023 •
Copy link
Copy Markdown
Contributor

Closes #24792

The lowerCaseHostname previously was assuming that the scheme was http (starting at 7 until next char /). That created issues with other custom schemes and does not lower the the host in case of https. The PR uses KeycloakUriBuilder to perform the lower in the passed redirect URI to verify and in the valid redirect URIs defined (scheme and host which are the parts are case-insensitive by spec). This way I think we are covering al the cases that are working now. I have added several unit tests to check this is working. CI passes OK.

@rmartinc
rmartinc requested a review from a team as a code owner November 17, 2023 11:14
Closes keycloak#24792

Signed-off-by: rmartinc <rmartinc@redhat.com>
@cgeorgilakis
Copy link
Copy Markdown
Contributor

We believe that this PR solve the bug in a wrong way.
Client redirect_uri check must be compared using exact string matching.
For details see related discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid redirect_uri if it contains uppercase letters

3 participants

0