8000 fix: PAR authorization request supports registration via `prompt=create` by vilmosnagy · Pull Request #50183 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

fix: PAR authorization request supports registration via prompt=create - #50183

Merged
mposolda merged 2 commits into
keycloak:mainfrom
vilmosnagy:vilmos/issue_49255
Jun 22, 2026
Merged

mposolda merged 2 commits into
keycloak:mainfrom
vilmosnagy:vilmos/issue_49255

Conversation

@vilmosnagy
Copy link
Copy Markdown
Contributor

Closes #49255
Based on #47244

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.

Pull request overview

This PR fixes handling of OpenID Connect prompt=create when the authorization request parameters are delivered via Pushed Authorization Requests (PAR), ensuring the registration page is shown as it is for non-PAR flows.

Changes:

  • Update OIDC AuthorizationEndpoint to consider prompt even when not present in the browser request (PAR scenario).
  • Add a PAR test that uses prompt=create and verifies the registration page opens.
  • Extend the test PAR request helper to allow setting prompt.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/utils-shared/src/main/java/org/keycloak/testsuite/util/oauth/ParRequest.java Adds a prompt() helper to include prompt in PAR requests for tests.
tests/base/src/test/java/org/keycloak/tests/oid4vc/issuance/signing/OID4VCAuthorizationCodeFlowWithPARTest.java Adds coverage verifying prompt=create over PAR opens the registration flow.
services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java Adjusts prompt=create handling so PAR-delivered prompt can trigger registration.

Comment on lines +227 to +231
String promptValue = Optional
.ofNullable(params.getFirst(OAuth2Constants.PROMPT))
.orElseGet(() -> session.getContext().getAuthenticationSession().getClientNote(OAuth2Constants.PROMPT));

if (OIDCLoginProtocol.PROMPT_VALUE_CREATE.equals(promptValue)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Original code had this raw equality check, so I'd only touch this if someone from Keycloak project asks for it.

Comment on lines +81 to +84
public ParRequest prompt(String prompt) {
parameter(OIDCLoginProtocol.PROMPT_PARAM, prompt);
return this;
}
< 8000 div class="js-comments-holder" >
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky te 8000 sts prior to merging the PR.

org.keycloak.testsuite.forms.BruteForceTest#testGrantMissingOtp

Keycloak CI - Forms IT (chrome)

org.opentest4j.AssertionFailedError: Expected error event ==> expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot 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.

Unreported flaky test detected, please review

@mposolda mposolda self-assigned this Jun 22, 2026
mposolda
mposolda previously approved these changes Jun 22, 2026
@mposolda mposolda 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.

@vilmosnagy Thanks! I hope your PR can be merged once tests are OK. Tried to re-run the failing UI tests, which likely failed due the other reason that your PR.

@vilmosnagy
Copy link
Copy Markdown
Contributor Author

Tried to re-run the failing UI tests, which likely failed due the other reason that your PR.

Thanks @mposolda. To be honest, I didn't even check the admin ui e2e test failure -> it failed a bunch of times in CI unrelated to my changes on the few PRs I had the past month (and after a re-run sometimes it become green, sometimes it turned red again with a simple rebase).

It seems to be unrelated again:

Notice:   1 failed
    [chromium] › test/realm-settings/general.spec.ts:64:3 › Realm settings general tab tests › realm enable/disable switch 

If re-running wont fix this, pls ping me and I'm going to check more deeply.

@vilmosnagy
Copy link
Copy Markdown
Contributor Author

🤔 I see that it fails for the 3rd time - let me check this evening.

Copilot AI review requested due to automatic review settings June 22, 2026 11:04
8000 @vilmosnagy
vilmosnagy force-pushed the vilmos/issue_49255 branch from f8fb528 to d42fc53 Compare June 22, 2026 11:04
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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings June 22, 2026 11:17
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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +247 to +248
registerPage.register("Vilmos", "Szabó-Nagy", "vilmos@email", "vnagy", "AppleTree123");
testRealm.cleanup().add(r -> r.users().search("vnagy").stream().findFirst().ifPresent(u -> r.users().delete(u.getId())));
@vilmosnagy
vilmosnagy commented Jun 22, 2026 •
Copy link
Copy Markdown
Contributor Author

@mposolda I rebased my PR, and js tests seems to be fixed here: https://github.com/keycloak/keycloak/actions/runs/27948119713

Applied the code changes from Claude Copilot - after this apply the Github Actions status seems to be flaky, and does not update. Is that possible? 🤔

vilmosnagy and others added 2 commits June 22, 2026 14:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Nagy Vilmos <me@vnagy.eu>
@mposolda
mposolda force-pushed the vilmos/issue_49255 branch from 70335a2 to 6faa332 Compare June 22, 2026 12:20
@mposolda
Copy link
Copy Markdown
Contributor

@vilmosnagy I did remote rebase of your branch and CI is running. Hopefully it is OK and your PR can be merged.

@mposolda
mposolda merged commit 7d31f08 into keycloak:main Jun 22, 2026
88 checks passed
@vilmosnagy
Copy link
Copy Markdown
Contributor Author

Thanks for the quick review & merge!

EA8E

sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
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.

PAR authorization request with prompt=create does not open registration page

3 participants

0