mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-19 22:44:18 +00:00
Optionally allow OIDC password grant for CLI-based login experience
- Add `AllowPasswordGrant` boolean field to OIDCIdentityProvider's spec
- The oidc upstream watcher controller copies the value of
`AllowPasswordGrant` into the configuration of the cached provider
- Add password grant to the UpstreamOIDCIdentityProviderI interface
which is implemented by the cached provider instance for use in the
authorization endpoint
- Enhance the IDP discovery endpoint to return the supported "flows"
for each IDP ("cli_password" and/or "browser_authcode")
- Enhance `pinniped get kubeconfig` to help the user choose the desired
flow for the selected IDP, and to write the flow into the resulting
kubeconfg
- Enhance `pinniped login oidc` to have a flow flag to tell it which
client-side flow it should use for auth (CLI-based or browser-based)
- In the Dex config, allow the resource owner password grant, which Dex
implements to also return ID tokens, for use in integration tests
- Enhance the authorize endpoint to perform password grant when
requested by the incoming headers. This commit does not include unit
tests for the enhancements to the authorize endpoint, which will come
in the next commit
- Extract some shared helpers from the callback endpoint to share the
code with the authorize endpoint
- Add new integration tests
This commit is contained in:
@@ -237,7 +237,8 @@ func WithRequestAudience(audience string) Option {
|
||||
// WithCLISendingCredentials causes the login flow to use CLI-based prompts for username and password and causes the
|
||||
// call to the Issuer's authorize endpoint to be made directly (no web browser) with the username and password on custom
|
||||
// HTTP headers. This is only intended to be used when the issuer is a Pinniped Supervisor and the upstream identity
|
||||
// provider type supports this style of authentication. Currently this is supported by LDAPIdentityProviders.
|
||||
// provider type supports this style of authentication. Currently, this is supported by LDAPIdentityProviders
|
||||
// and by OIDCIdentityProviders which optionally enable the resource owner password credentials grant flow.
|
||||
// This should never be used with non-Supervisor issuers because it will send the user's password to the authorization
|
||||
// endpoint as a custom header, which would be ignored but could potentially get logged somewhere by the issuer.
|
||||
func WithCLISendingCredentials() Option {
|
||||
|
||||
Reference in New Issue
Block a user