Enable scope updates with iframe flow. #3040
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.
Description
An experiment that enables session scope expansion without a full browser refresh. The method uses the IFrame OIDC flow.
Changes
Since the iframe flow was not used, we had some misconfiguration of the OIDC client which surfaced once the flow was "forced".
silent-check-sso.html
between dev and prod buildsilent-check-sso.html
post message payload (it was still using the keycloack-js signature)reAuthWithScopes
will try the iframe flow and fallbacks tosignInRedirect
if it failsuseUserSSOScopes
is now usingreAuthWithScopes
instead of theauth.login
directlyCaveats
The OIDC client we use will ignore the iframe flow if a refresh_token was provided. This is ok unless we want the scopes to be updated. There is no supported way of disabling the refresh_token refresh unless the refresh_token is disabled directly in the KC settings. It's not something we want.
However, we can patch the condition in the node_modules and disable it via global variable (simplest possible change). We can leverage https://github.com/ds300/patch-package to do so. Ideally, we would try to work with the client maintainers to find a proper solution. But if we decide to accept this change, we at least can do so before we manage to update the client code.