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

shell: Add defaultDexConnector option to automatically trigger login on a predefined Dex connector #3443

Merged
merged 2 commits into from
Sep 14, 2021

Conversation

JBWatenbergScality
Copy link
Contributor

Component:

shell

Context:

Dex is providing the possibility to use several connectors to federate OIDC providers. However under some conditions we may need to force the usage of a specific connector.

Summary:

This PR add a defaultDexConnector option to enable this.

This option can be added to the auth section of micro application runtime-app-configuration.
It intercept the authorization_endpoint of the oidc web finger and append it the connector_id query parameter.

The connector choice can be forced by adding the displayLoginChoice query parameter to the current URL.
This enable to maintain UI login possible when the default connector is unavailable.

Additionaly as Dex is not supporting end_session_endpoint the logout is reviewed to clean the cookies of the
domain and clearing the localStorage entries of oidc client when providerLogout is set to true.

Acceptance criteria:

We shall be able to login directly using the default dex connector when the property is defined

@bert-e
Copy link
Contributor

bert-e commented Jul 9, 2021

Hello jbwatenbergscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Jul 9, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JBWatenbergScality JBWatenbergScality added the topic:ui UI-related issues label Jul 9, 2021
@JBWatenbergScality JBWatenbergScality marked this pull request as ready for review July 19, 2021 10:08
@JBWatenbergScality JBWatenbergScality requested a review from a team as a code owner July 19, 2021 10:08
@bert-e
Copy link
Contributor

bert-e commented Jul 19, 2021

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Jul 19, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@@ -39,6 +57,9 @@ function OAuth2AuthProvider({ children }: { children: Node }) {
loadUserInfo: true,
automaticSilentRenew: true,
monitorSession: false,
MetadataServiceCtor: authConfig.defaultDexConnector
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering should we add this defaultDexConnector prop to type OIDCConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in db1812c

@@ -39,6 +57,9 @@ function OAuth2AuthProvider({ children }: { children: Node }) {
loadUserInfo: true,
automaticSilentRenew: true,
monitorSession: false,
MetadataServiceCtor: authConfig.defaultDexConnector
? defaultDexConnectorMetadataService(authConfig.defaultDexConnector)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's more a question:
If we want to use Dex to authenticate the users against a connector-based interface, how should we set the defaultDexConnector in runtime-app-configuration?

Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't we start documenting all this rework of shell-ui? Would be useful IMO, both now for reviewers catching up with the progress, and in the future for maintenance / onboarding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

defaultDexConnector should take the connector id as defined in dex configuration.
For example given the following Dex connectors configuration :

       connectors:
            - type: oidc
              id: keycloak
              name: Keycloak
              config:
                   //....

Providing keycloak as defaultDexConnector in runtime-app-configuration will automatically redirect the user to this connector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've opened #3476 regarding the documentation and will address it as soon as possible

Copy link
Contributor

@gdemonet gdemonet left a comment

Choose a reason for hiding this comment

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

No need to tackle documentation as part of this PR 😉

shell-ui/src/auth/AuthProvider.js Show resolved Hide resolved
shell-ui/src/auth/AuthProvider.js Outdated Show resolved Hide resolved
shell-ui/src/auth/AuthProvider.js Outdated Show resolved Hide resolved
@@ -39,6 +57,9 @@ function OAuth2AuthProvider({ children }: { children: Node }) {
loadUserInfo: true,
automaticSilentRenew: true,
monitorSession: false,
MetadataServiceCtor: authConfig.defaultDexConnector
? defaultDexConnectorMetadataService(authConfig.defaultDexConnector)
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't we start documenting all this rework of shell-ui? Would be useful IMO, both now for reviewers catching up with the progress, and in the future for maintenance / onboarding.

@bert-e
Copy link
Contributor

bert-e commented Jul 20, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@JBWatenbergScality JBWatenbergScality force-pushed the improvement/add-dex-default-connector-option branch from 72d160d to e656680 Compare August 4, 2021 07:59
@bert-e
Copy link
Contributor

bert-e commented Aug 4, 2021

History mismatch

Merge commit #72d160dc1c6470be75c092cfd23c7ed969af5b1f on the integration branch
w/2.11/improvement/add-dex-default-connector-option is merging a branch which is neither the current
branch improvement/add-dex-default-connector-option nor the development branch
development/2.11.

It is likely due to a rebase of the branch improvement/add-dex-default-connector-option and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

@JBWatenbergScality
Copy link
Contributor Author

/reset

@bert-e
Copy link
Contributor

bert-e commented Aug 4, 2021

Reset complete

I have successfully deleted this pull request's integration branches.

@bert-e
Copy link
Contributor

bert-e commented Aug 4, 2021

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Aug 4, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@JBWatenbergScality JBWatenbergScality changed the base branch from development/2.10 to development/2.11 September 6, 2021 08:56
@bert-e
Copy link
Contributor

bert-e commented Sep 6, 2021

Branches have diverged

This pull request's source branch improvement/add-dex-default-connector-option has diverged from
development/2.11 by more than 50 commits.

To avoid any integration risks, please re-synchronize them using one of the
following solutions:

  • Merge origin/development/2.11 into improvement/add-dex-default-connector-option
  • Rebase improvement/add-dex-default-connector-option onto origin/development/2.11

Note: If you choose to rebase, you may have to ask me to rebuild
integration branches using the reset command.

@JBWatenbergScality
Copy link
Contributor Author

/reset

@bert-e
Copy link
Contributor

bert-e commented Sep 6, 2021

Reset complete

I have successfully deleted this pull request's integration branches.

@bert-e
Copy link
Contributor

bert-e commented Sep 6, 2021

Branches have diverged

This pull request's source branch improvement/add-dex-default-connector-option has diverged from
development/2.11 by more than 50 commits.

To avoid any integration risks, please re-synchronize them using one of the
following solutions:

  • Merge origin/development/2.11 into improvement/add-dex-default-connector-option
  • Rebase improvement/add-dex-default-connector-option onto origin/development/2.11

Note: If you choose to rebase, you may have to ask me to rebuild
integration branches using the reset command.

…on a predefined Dex connector.

This option can be added to the auth section of micro application `runtime-app-configuration`.
It intercept the authorization_endpoint of the oidc web finger and append it the `connector_id` query parameter.

The connector choice can be forced by adding the `displayLoginChoice` query parameter to the current URL.
This enable to maintain UI login possible when the default connector is unavailable.
…session_endpoint is not supported

Dex is not supporting `end_session_endpoint` the logout is reviewed to clean the cookies of the
domain and clearing the localStorage entries of oidc client when `providerLogout` is set to true.

Ref: #2831
@JBWatenbergScality JBWatenbergScality force-pushed the improvement/add-dex-default-connector-option branch from e656680 to a06e266 Compare September 6, 2021 09:13
@bert-e
Copy link
Contributor

bert-e commented Sep 6, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@bert-e
Copy link
Contributor

bert-e commented Sep 14, 2021

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@JBWatenbergScality
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Sep 14, 2021

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.11

The following branches will NOT be impacted:

  • development/2.0
  • development/2.1
  • development/2.10
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Sep 14, 2021

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.11

The following branches have NOT changed:

  • development/2.0
  • development/2.1
  • development/2.10
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

Please check the status of the associated issue None.

Goodbye jbwatenbergscality.

@bert-e bert-e merged commit 68d5c36 into development/2.11 Sep 14, 2021
@bert-e bert-e deleted the improvement/add-dex-default-connector-option branch September 14, 2021 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:ui UI-related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants