You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(auth): separate Google and Generic MCP OAuth verification (#3341)
- enforce "active" and "issuer" field checks in generic OAuth
- support MCP auth separately in "google" type authService because
Google OAuth tokeninfo endpoint returns non-standard token validation
response.
Copy file name to clipboardExpand all lines: docs/en/documentation/configuration/authentication/generic.md
+12-21Lines changed: 12 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ When a request is received in this mode, the service will:
48
48
#### Example
49
49
50
50
```yaml
51
-
kind: authServices
51
+
kind: authService
52
52
name: my-generic-auth
53
53
type: generic
54
54
audience: ${YOUR_OIDC_AUDIENCE}
@@ -112,7 +112,7 @@ When a request is received in this mode, the service will:
112
112
#### Example
113
113
114
114
```yaml
115
-
kind: authServices
115
+
kind: authService
116
116
name: my-generic-auth
117
117
type: generic
118
118
audience: ${YOUR_TOKEN_AUDIENCE}
@@ -123,28 +123,19 @@ scopesRequired:
123
123
- write
124
124
```
125
125
126
-
#### Google Opaque Access Token Validation Example
126
+
#### Google Authentication Note
127
127
128
-
To use Google's `tokeninfo` endpoint for validating opaque access tokens, configure the service to use the `GET` method and `access_token` parameter name:
> Do not configure Google's tokeninfo endpoint (`https://oauth2.googleapis.com/tokeninfo`) using `type: generic`. Because the generic OIDC service strictly enforces the presence and validity of the `active` claim (RFC 7662), and Google's tokeninfo endpoint does not return this claim, validation will fail.
130
+
>
131
+
> To authenticate with Google tokens, use the native [Google Sign-In](./google.md) auth service (`type: google`) instead, which natively handles Google's endpoints and token formats.
141
132
142
133
#### Okta OIDC Configuration Example
143
134
144
135
To secure your MCP server or tools using Okta as the identity provider:
145
136
146
137
```yaml
147
-
kind: authServices
138
+
kind: authService
148
139
name: okta-auth
149
140
type: generic
150
141
audience: api://default # Or your custom Okta audience
@@ -197,7 +188,7 @@ ${ENV_NAME} instead of hardcoding your secrets into the configuration file.
197
188
| audience | string | true | The expected audience (`aud` claim) in the token. This ensures the token was minted specifically for your application. See [Getting Started](#getting-started) for details on OIDC audience matching. |
198
189
| authorizationServer | string | true | The base URL of your OIDC provider. The service will append `/.well-known/openid-configuration` to discover the JWKS URI. HTTP is allowed but logs a warning. |
199
190
| mcpEnabled | bool | false | Indicates if MCP endpoint authentication should be applied. Defaults to false. |
200
-
| scopesRequired | []string | false | A list of required scopes that must be present in the token's `scope` claim to be considered valid. |
201
-
| introspectionEndpoint | string | false | Optional override for the token introspection URL. Useful if the provider does not list it in OIDC discovery (e.g., Google). |
202
-
| introspectionMethod | string | false | HTTP method to use for introspection. Defaults to "POST". Set to "GET" for providers like Google. |
203
-
| introspectionParamName | string | false | Parameter name for the token in the introspection request. Defaults to "token". Set to "access_token" for Google. |
191
+
| scopesRequired | []string | false | A list of required scopes that must be present in the token's `scope` claim to be considered valid. Disallowed if `mcpEnabled` is false. |
192
+
| introspectionEndpoint | string | false | Optional override for the token introspection URL. Useful if the provider does not list it in OIDC discovery (e.g., Google). Disallowed if `mcpEnabled` is false. |
193
+
| introspectionMethod | string | false | HTTP method to use for introspection. Defaults to "POST". Set to "GET" for providers like Google. Disallowed if `mcpEnabled` is false. |
194
+
| introspectionParamName | string | false | Parameter name for the token in the introspection request. Defaults to "token". Set to "access_token" for Google. Disallowed if `mcpEnabled` is false. |
Copy file name to clipboardExpand all lines: docs/en/documentation/configuration/authentication/google.md
+55-30Lines changed: 55 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,57 +3,82 @@ title: "Google Sign-In"
3
3
type: docs
4
4
weight: 1
5
5
description: >
6
-
Use Google Sign-In for Oauth 2.0 flow and token lifecycle.
6
+
Use Google Sign-In for OAuth 2.0 flow and token lifecycle.
7
7
---
8
8
9
9
## Getting Started
10
10
11
-
Google Sign-In manages the OAuth 2.0 flow and token lifecycle. To integrate the
12
-
Google Sign-In workflow to your web app [follow this guide][gsi-setup].
11
+
Google Sign-In manages the OAuth 2.0 flow and token lifecycle. To integrate the Google Sign-In workflow to your web app, [follow this guide][gsi-setup].
13
12
14
-
After setting up the Google Sign-In workflow, you should have registered your
15
-
application and retrieved a [Client ID][client-id]. Configure your auth service
16
-
in with the `Client ID`.
13
+
After setting up Google Sign-In, configure your auth service in the toolbox. The Google auth provider supports two distinct validation modes:
When using [Authorized Invocations][auth-invoke], a tool will be
26
-
considered authorized if it has a valid Oauth 2.0 token that matches the Client
27
-
ID.
22
+
### 1. Web App OIDC Authentication
23
+
If you are developing a web application using the Toolbox and need to retrieve user claims from Google ID tokens sent in custom request headers, configure the `clientId` field.
To secure all endpoints on your MCP server using Google OAuth tokens, enable `mcpEnabled` and specify the `audience` field.
39
40
40
-
## Example
41
+
- **Header**: Expects the token in the standard `Authorization: Bearer <token>` header.
42
+
- **Token Type**: Supports both Google **ID tokens (JWT)** and Google **opaque access tokens**.
41
43
44
+
#### Example
42
45
```yaml
43
46
kind: authService
44
47
name: my-google-auth
45
48
type: google
46
-
clientId: ${YOUR_GOOGLE_CLIENT_ID}
49
+
audience: ${YOUR_GOOGLE_CLIENT_ID}
50
+
mcpEnabled: true
51
+
scopesRequired:
52
+
- https://www.googleapis.com/auth/userinfo.email
47
53
```
48
54
49
-
{{< notice tip >}}
50
-
Use environment variable replacement with the format ${ENV_NAME}
51
-
instead of hardcoding your secrets into the configuration file.
52
-
{{< /notice >}}
55
+
> [!IMPORTANT]
56
+
> - For **ID tokens (JWT)**: Local cryptographic signature verification is performed, which requires `audience` to be configured. If `audience` is not set, the provider will fall back to using `clientId`. If neither is configured, validation will fail.
57
+
> - For **Opaque tokens**: The provider automatically queries Google's secure tokeninfo endpoint (`https://oauth2.googleapis.com/tokeninfo`) and validates the resulting audience against the configured `audience` field (falling back to `clientId` if `audience` is not set).
58
+
59
+
---
60
+
61
+
## Behavior
62
+
63
+
### Authorized Invocations
64
+
When using [Authorized Invocations][auth-invoke], a tool will be considered authorized if it has a valid OAuth 2.0 token that matches the Client ID or Audience.
| clientId | string | false | Client ID of your application. Required for validating ID tokens in non-MCP web apps (`GetClaimsFromHeader`), and acts as a fallback for `audience` in MCP auth mode if `audience` is not configured. |
82
+
| audience | string | false | Expected audience. Required for validating ID tokens in MCP Auth mode (unless `clientId` is configured as a fallback). If specified, also validates opaque token audiences. Disallowed if `mcpEnabled` is false. |
83
+
| mcpEnabled | bool | false | Enforces global MCP transport authentication using the `Authorization: Bearer` header. Defaults to false. |
84
+
| scopesRequired | []string | false | A list of required scopes that must be present in the token's claims/metadata to be considered valid. Disallowed if `mcpEnabled` is false. |
0 commit comments