8000 Do not strip hash from redirection endpoint by jonkoops · Pull Request #219 · keycloak/keycloak-js · GitHub
[go: up one dir, main page]

Skip to content

Do not strip hash from redirection endpoint - #219

Merged
jonkoops merged 1 commit into
keycloak:mainfrom
jonkoops:rm-strip-hash
Nov 19, 2025
Merged

jonkoops merged 1 commit into
keycloak:mainfrom
jonkoops:rm-strip-hash

Conversation

@jonkoops
Copy link
Copy Markdown
Contributor

Removes the behavior that strips the hashes from the redirection endpoint URLs. Although this behavior is not standard compliant, it fixes several regressions in instances where users rely on this non-standard behavior.

Closes #151
Closes #205

@jonkoops
Copy link
Copy Markdown
Contributor Author

@benzitohhh @rmartinc could I ask you to verify this fix works for you?

Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the non-standard behavior of stripping hash fragments from redirect URIs in OAuth flows. While the previous implementation followed RFC 6749 section 3.1.2 (which prohibits fragment components in redirect URIs), this change restores hash support to fix regressions for users who rely on redirect URIs containing hash fragments.

Key Changes:

  • Removed stripHash() function calls from redirect URI parameters in both authorization requests and token exchange
  • Deleted the stripHash() utility function and its associated RFC compliance comments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Closes keycloak#151
Closes keycloak#205

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@pskopek pskopek left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rmartinc rmartinc left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the admin and account console and everything is OK. Thanks @jonkoops! Approved!

@benzitohhh
Copy link
Copy Markdown

@benzitohhh could I ask you to verify this fix works for you?

@jonkoops Perfect - looks great to me.

@jonkoops
Copy link
Copy Markdown
Contributor Author

Thanks for the reviews all, merging this in.

@jonkoops
jonkoops merged commit da63285 into keycloak:main Nov 19, 2025
4 checks passed
@jonkoops
jonkoops deleted the rm-strip-hash branch November 19, 2025 15:17
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.

New version 26.2.1 does not redirect to the correct fragment in admin console stripHash adds trailing slash (breaks redirectUri)

5 participants

0