Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for prompt=create in keycloak.js #36632

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mposolda
Copy link
Contributor

closes keycloak/keycloak-js#6

Marking as draft as I am not sure if we still want to add new capabilities to keycloak.js or do we rather already want to use newly created repository for keycloak.js new features? If we want new repository, the pre-requisite for this PR would be to move keycloak.js adapter (including documentation) to that repository.

The PR introduces support to detect if Keycloak server supports new OIDC way for requesting registration (the one with prompt=create supported from Keycloak server 26.1) or the old way with the deprecated registration endpoint. For this purpose, the PR always sends request to OIDC well-known endpoint unless the option omitWellKnownConfigRequest is used. Before this PR, the request to well-known endpoint was sent just when the constructor property oidcProvider was used (BTW. this property oidcProvider is not officially documented). The request to OIDC well-known endpoint can dynamically detect if new registration is supported or not and IMO it can be possibly used for more capabilities in the future.

The 2 new properties to init method introduced:

  • omitWellKnownConfigRequest - Whether to omit request to OIDC well-known endpoint (false by default)
  • useDeprecatedRegisterEndpoint - Whether to enforce to use deprecated register endpoint. I am not 100% sure if we need this option as we can possibly always rely on the response from well-known endpoint to see whether new way is supported or not? If we avoid this option and the option omitWellKnownConfigRequest=true, we can default to use new register endpoint?

@mposolda mposolda self-assigned this Jan 21, 2025
@jonkoops jonkoops self-requested a review January 21, 2025 10:16
@mposolda mposolda force-pushed the 36085-keycloak-js-register branch from dacabee to 32c2c8a Compare January 23, 2025 18:52
closes #36085

Signed-off-by: mposolda <[email protected]>
@mposolda mposolda force-pushed the 36085-keycloak-js-register branch from 32c2c8a to acc3f8d Compare January 24, 2025 07:54
Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

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

@keycloak-github-bot
Copy link

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 tests prior to merging the PR.

org.keycloak.testsuite.webauthn.account.WebAuthnErrorTest#errorPageWithTimeout

Keycloak CI - WebAuthn IT (chrome)

org.openqa.selenium.WebDriverException: 
aborted by navigation: loader has changed while resolving nodes
  (Session info: chrome=132.0.6834.83)
Build info: version: '4.25.0', revision: '8a8aea2337'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.8.0-1020-azure', java.version: '21.0.5'
...
org.openqa.selenium.WebDriverException: 
aborted by navigation: loader has changed while resolving nodes
  (Session info: chrome=132.0.6834.83)
Build info: version: '4.25.0', revision: '8a8aea2337'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.8.0-1020-azure', java.version: '21.0.5'
...

Report flaky test

@jonkoops
Copy link
Contributor

jonkoops commented Feb 3, 2025

@mposolda we're moving the KJS code to the new repo, so let's handle this there once completed.

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.

Support for prompt=create in keycloak.js
2 participants