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

feat: add SSO #181

Merged
merged 13 commits into from
Mar 28, 2023
Merged

feat: add SSO #181

merged 13 commits into from
Mar 28, 2023

Conversation

oleobal
Copy link
Contributor

@oleobal oleobal commented Mar 11, 2023

Description

Add mechanism to handle a new authentication flow: single sign-on (SSO) through OpenID Connect (OIDC).

Changes:

  • on the login page, we query the /info endpoint to see whether SSO is available, and if so present a button. All the button does is redirect to the backend at /oidc/authenticate?next={some frontend page}. The backend does everything else

  • add the current username in the header menu, because with SSO the username is not obvious

  • add an "API tokens" modal (in the header menu) so SSO users can use the library (they don't have a password).

    In the future we will deprecate logging in on the command line, and that modal will be a nice interface for creating and managing API tokens. Probably.

Issues: (to be fixed in a future PR, presumably)

  • active tokens make too many requests and should go through Redux
  • API tokens modal is ugly

How to test

Only the actual login requires special set-up.

Set up an SSO-capable backend: Substra/substra-backend#609

Then just edit vite.config.ts to point to http://substra-backend.org-1.com (without the port number, because we're hosting on the cluster rather than in isolated mode). That should be it.

It's also possible to test the frontend in isolated mode but that requires more set-up on the backend so I'll let you figure it out.

To do

  • update changelog
  • investigate login/logout redirects (using the logout button and then logging in again works weird) can't reproduce

@oleobal oleobal force-pushed the feat/sso-oidc branch 5 times, most recently from 8e8f06a to 3df2c17 Compare March 23, 2023 10:08
@oleobal oleobal marked this pull request as ready for review March 23, 2023 13:10
@oleobal oleobal requested review from HamdyD, jmorel and a team as code owners March 23, 2023 13:10
@oleobal oleobal force-pushed the feat/sso-oidc branch 2 times, most recently from b373286 to 9f57d0b Compare March 26, 2023 10:34
src/assets/chakraTheme.ts Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/modules/bearerTokens/BearerTokenApi.ts Outdated Show resolved Hide resolved
src/modules/bearerTokens/BearerTokenApi.ts Outdated Show resolved Hide resolved
src/modules/bearerTokens/BearerTokenApi.ts Outdated Show resolved Hide resolved
src/routes/login/components/LoginForm.tsx Outdated Show resolved Hide resolved
src/routes/login/components/LoginForm.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@Milouu Milouu left a comment

Choose a reason for hiding this comment

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

Nice work :) Could only test the Google auth

jmorel
jmorel previously requested changes Mar 28, 2023
src/routes/login/components/LoginForm.tsx Outdated Show resolved Hide resolved
src/routes/login/components/LoginForm.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
src/components/ApiToken.tsx Outdated Show resolved Hide resolved
oleobal added 11 commits March 28, 2023 17:46
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
To be more consistent with nomenclature

Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
With design guidance from David

Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: Olivier Léobal <[email protected]>
@oleobal oleobal requested a review from jmorel March 28, 2023 15:51
@oleobal oleobal dismissed jmorel’s stale review March 28, 2023 15:58

Addressed in call

@oleobal oleobal merged commit 51b4922 into main Mar 28, 2023
@oleobal oleobal deleted the feat/sso-oidc branch March 28, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants