Console OIDC generate token#35609
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
|
40a42d6 to
97a881b
Compare
| return (claims.email as string) ?? (claims.sub as string) ?? ""; | ||
| }, [idToken]); | ||
|
|
||
| const obfuscated = idToken ? "*".repeat(Math.min(idToken.length, 40)) : ""; |
There was a problem hiding this comment.
nit: Maybe we can reuse the obfuscate code in formatAppPassword?
| const claims = decodeJwtPayload(idToken); | ||
| return (claims.email as string) ?? (claims.sub as string) ?? ""; |
There was a problem hiding this comment.
So we don't actually know if these claims represent the authentication claim. Ultimately it's controlled by the system variable OIDC_AUTHENTICATION_CLAIM. I'd maybe just add a placeholder here in the UI
| apiClient.type === "self-managed" && | ||
| apiClient.oidcManager?.getIdToken() ? ( |
There was a problem hiding this comment.
Perhaps appConfig.authMode is enough given we use useAuth later on anyways? Same for the navbar in NavBar.tsx.
Also should we be concerned about the token returned from getIdToken (since it's cached) vs. the token returned from useAuth?
There was a problem hiding this comment.
Yep! overlooked this change from the last PR refactors but addressed this in the latest commit
97a881b to
0127d7f
Compare
- Similar to connect modal in the cloud, oidc connect modal let's the user authenticate for a pgwire connection using the id token PR feedback: - moved password obfuscation to a shared utility to be used for OIDC modal and frontegg modal - Removed check for appclient.type === "self-managed" - Retrieving token value from useAuth().user.idtoken
0127d7f to
6ed05ac
Compare
### Motivation This is a stacked PR for OIDC login PR: MaterializeInc#35440 This PR let's the user retrieve the ID token for psql connection string Changes that would go in are from the last commit ### Description - Added OIDC Connection modal similar to Connect modal for cloud console to show the connection instructions and ID token <img width="2680" height="1598" alt="image" src="https://github.com/user-attachments/assets/494b2949-827f-489d-afd9-6ca86bf890b5" /> ### Verification Once logged in using SSO, take the connection string and put that in the terminal. You will be prompted to put in a password so copy and paste the id token to get authenticated
### Motivation This is a stacked PR for OIDC login PR: MaterializeInc#35440 This PR let's the user retrieve the ID token for psql connection string Changes that would go in are from the last commit ### Description - Added OIDC Connection modal similar to Connect modal for cloud console to show the connection instructions and ID token <img width="2680" height="1598" alt="image" src="https://github.com/user-attachments/assets/494b2949-827f-489d-afd9-6ca86bf890b5" /> ### Verification Once logged in using SSO, take the connection string and put that in the terminal. You will be prompted to put in a password so copy and paste the id token to get authenticated
### Motivation This is a stacked PR for OIDC login PR: MaterializeInc#35440 This PR let's the user retrieve the ID token for psql connection string Changes that would go in are from the last commit ### Description - Added OIDC Connection modal similar to Connect modal for cloud console to show the connection instructions and ID token <img width="2680" height="1598" alt="image" src="https://github.com/user-attachments/assets/494b2949-827f-489d-afd9-6ca86bf890b5" /> ### Verification Once logged in using SSO, take the connection string and put that in the terminal. You will be prompted to put in a password so copy and paste the id token to get authenticated
Motivation
This is a stacked PR for OIDC login PR: #35440
This PR let's the user retrieve the ID token for psql connection string
Changes that would go in are from the last commit
Description
Verification
Once logged in using SSO, take the connection string and put that in the terminal. You will be prompted to put in a password so copy and paste the id token to get authenticated