8000 Accept private-use scheme redirect URIs in Admin API v2 by Praiztl · Pull Request #55783 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Accept private-use scheme redirect URIs in Admin API v2 - #55783

Open
Praiztl wants to merge 1 commit into
keycloak:mainfrom
Praiztl:fix/55729-private-use-scheme-redirect-uri
Open

Praiztl wants to merge 1 commit into
keycloak:mainfrom
Praiztl:fix/55729-private-use-scheme-redirect-uri

Conversation

@Praiztl
@Praiztl Praiztl commented Dec 3, 2026
Copy link
Copy Markdown

Closes #55729

Decisions and assumptions:

  • Treat any "scheme:" prefix as an absolute URI per RFC 3986, rather than requiring "scheme://". This is the RFC 8252 private-use scheme form used by native apps.
  • Kept the regex check instead of parsing with java.net.URI, so wildcard redirect URIs such as https://app/*, which are not valid java.net.URI values, keep validating.

This change was made with the assistance of an AI agent.

The scheme pattern required a literal "://", so an RFC 8252 private-use scheme redirect URI such as com.example.app:/oauth2redirect was treated as relative and rejected when the client had no root URL. A scheme followed by ":" is already an absolute URI under RFC 3986, so match that instead of requiring an authority.

Signed-off-by: Tochukwu Chikezie <95018735+Praiztl@users.noreply.github.com>
@Praiztl
Praiztl force-pushed the fix/55729-private-use-scheme-redirect-uri branch from 2d4c316 to 5138c81 Compare December 4, 2026 10:01
@Praiztl
Praiztl marked this pull request as ready for review December 4, 2026 11:43
@Praiztl
Praiztl requested review from a team as code owners December 4, 2026 11:43
Copilot AI balanced review requested due to automatic review settings December 4, 2026 11:43
Copilot AI 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.

🟢 Approval recommended

The review identifies no active issues with the private-use scheme redirect URI update.

No open issues 🎉

What changed in this PR

Fixes #55729 by allowing Admin API v2 to accept RFC 8252 private-use scheme redirect URIs used by native apps.

Changes:

  • Recognizes scheme: rather than requiring scheme://.
  • Adds regression tests for private-use scheme URIs and nested paths.
File Description
rest/​admin-v2/​tests/​src/​test/​java/​org/​keycloak/​tests/​admin/​client/​v2/​validation/​RedirectUriValidationTest.java Tests private-use scheme redirect URI validation.
rest/​admin-v2/​services/​src/​main/​java/​org/​keycloak/​representations/​admin/​v2/​validators/​ValidRedirectUrisValidator.java Updates and documents scheme detection.

Review effort: Balanced

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.

Admin API v2 rejects RFC 8252 private-use scheme redirect URIs (com.example.app:/callback) as "not absolute"

2 participants

0