Skip to content

Commit 2f1c0f5

Browse files
authored
Make client_id optional in vMCP OIDC config (#2822)
client_id is only required for specific flows like token introspection with client credentials. For standard JWT validation using JWKS, only issuer and audience are needed. This follows the same pattern as the previous change that made client_secret_env optional (d543c84).
1 parent 7420133 commit 2f1c0f5

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

pkg/vmcp/config/validator.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ func (v *DefaultValidator) validateIncomingAuth(auth *IncomingAuthConfig) error
9494
return fmt.Errorf("incoming_auth.oidc.issuer is required")
9595
}
9696

97-
if auth.OIDC.ClientID == "" {
98-
return fmt.Errorf("incoming_auth.oidc.client_id is required")
99-
}
100-
10197
if auth.OIDC.Audience == "" {
10298
return fmt.Errorf("incoming_auth.oidc.audience is required")
10399
}
104100

101+
// ClientID is optional - only required for specific flows:
102+
// - Token introspection with client credentials
103+
// - Some OAuth flows requiring client identification
104+
// Not required for standard JWT validation using JWKS
105+
105106
// ClientSecretEnv is optional - some OIDC flows don't require client secrets:
106107
// - PKCE flows (public clients)
107108
// - Token validation without introspection

pkg/vmcp/config/validator_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ func TestValidator_ValidateIncomingAuth(t *testing.T) {
140140
},
141141
wantErr: false,
142142
},
143+
{
144+
name: "valid OIDC auth without client_id (JWT validation only)",
145+
auth: &IncomingAuthConfig{
146+
Type: "oidc",
147+
OIDC: &OIDCConfig{
148+
Issuer: "https://example.com",
149+
Audience: "vmcp",
150+
},
151+
},
152+
wantErr: false,
153+
},
143154
{
144155
name: "invalid auth type",
145156
auth: &IncomingAuthConfig{

0 commit comments

Comments
 (0)