Skip to content

Commit d543c84

Browse files
authored
Make client_secret_env optional in vMCP OIDC config (#2803)
1 parent f08428d commit d543c84

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

pkg/vmcp/config/validator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ func (v *DefaultValidator) validateIncomingAuth(auth *IncomingAuthConfig) error
102102
return fmt.Errorf("incoming_auth.oidc.audience is required")
103103
}
104104

105-
// Client secret env var should be set (references a Kubernetes Secret mounted as env var)
106-
if auth.OIDC.ClientSecretEnv == "" {
107-
return fmt.Errorf("incoming_auth.oidc.client_secret_env is required")
108-
}
105+
// ClientSecretEnv is optional - some OIDC flows don't require client secrets:
106+
// - PKCE flows (public clients)
107+
// - Token validation without introspection
108+
// - Kubernetes service account token validation
109109
}
110110

111111
// Validate authorization configuration

pkg/vmcp/config/validator_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,18 @@ func TestValidator_ValidateIncomingAuth(t *testing.T) {
127127
},
128128
wantErr: false,
129129
},
130+
{
131+
name: "valid OIDC auth without client secret (public client)",
132+
auth: &IncomingAuthConfig{
133+
Type: "oidc",
134+
OIDC: &OIDCConfig{
135+
Issuer: "https://example.com",
136+
ClientID: "public-client",
137+
Audience: "vmcp",
138+
},
139+
},
140+
wantErr: false,
141+
},
130142
{
131143
name: "invalid auth type",
132144
auth: &IncomingAuthConfig{

0 commit comments

Comments
 (0)