-
Notifications
You must be signed in to change notification settings - Fork 394
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
🌱 proxy: optionally enable OIDC auth #2319
Conversation
This adds OIDC to the enabled optional auth methods
Some test notes - I tested this locally using dex standalone Since the kube API requires SSL, I generated certs using the gencert.sh script, modified so the SAN contained localhost e.g:
Then I ran dex with a config like:
kubelogin can then be used to test the login e.g:
Then create a clusterrolebinding as directed in the output. Then we can configure the proxy when running sharded-test-server e.g:
Then we can access KCP using OIDC auth with a kubeconfig containing a user like:
This is enough to prove the authn is working - but note when using the mock connector there is a limitation in that we can't configure groups for users - so if we want to test that, we'll need to run an IdP and use one of the "real" connectors instead. |
/cc @csams |
/test test Appears to be a flake ref kcp-dev/contrib-tmc#93 |
I did notice one weird thing:
I don't think that's caused by this PR, but will investigate if it's a real issue with the username, or something caused by my test setup |
Ok so the token looks like e.g
Then the
So the username ends up as KCP then replaces disallowed characters with |
After discussing with @csams I now understand that the issue above is because the dex dev-setup isn't setting name/preferred_username in the claim - I've not yet figured out how to resolve that for test/dev but it sounds like in practice this should work fine. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
This adds OIDC to the enabled optional auth methods
Related issue(s)
Follow-up to #2178