Support for prompt=create in keycloak.js #36632
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 optionomitWellKnownConfigRequest
is used. Before this PR, the request to well-known endpoint was sent just when the constructor propertyoidcProvider
was used (BTW. this propertyoidcProvider
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 optionomitWellKnownConfigRequest=true
, we can default to use new register endpoint?