console: OIDC login in console#35440
Open
leedqin wants to merge 2 commits intoMaterializeInc:mainfrom
Open
Conversation
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
544caa2 to
ab71600
Compare
ab71600 to
f965445
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Remove these sections if your commit already has a good description!
Motivation
This PR adds OIDC authentication for self managed console. Linear issue: CNS-25
Description
For the console to handle oidc authentication, here are the changes in this PR:
Added
oidc-client-tsandreact-oidc-contextlibraries to the consoleCreated an OIDC library wrapper for oidc libary to create a shared
User Managerthat caches ID token and exports the id token to be consumed by api clientTests that mock the oidc token and functions
Added "Oidc" to AppConfig so that oidc auth mode can be parsed from app-config.json
Created the
OidcProviderWrapper.tsxto initialize OIDC UserManager and wrap the children in AuthProvider when authmode === oidcIn apiClient.ts, when
authMode === oidc, oidc middleware will add aAuthorization: Bearer <idToken>if token exists. If no token, no header is sent -- session cookie is used implicitly. If a session expires, 401 redirect would handle expired sessionsIn the websocket,
getWsAuthConfigreturns the ID token if available,nullotherwiseAllow "Oidc" in auth.ts for password auth to work alongside OIDC
In the Login Box, the password auth option would also render along with "Use Single Sign on" link
Auth Flow:
Reviewing Tips
Verification
SSO_console.mov