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
Copy file name to clipboardExpand all lines: docs/en/documentation/configuration/authentication/_index.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,18 @@ description: >
6
6
AuthServices represent services that handle authentication and authorization.
7
7
---
8
8
9
-
AuthServices represent services that handle authentication and authorization. It
10
-
can primarily be used by [Tools](../tools/_index.md) in two different ways:
9
+
AuthServices represent services that handle authentication and authorization. They support two distinct modes of operation:
11
10
12
-
-[**Authorized Invocation**][auth-invoke] is when a tool
13
-
is validated by the auth service before the call can be invoked. Toolbox
14
-
will reject any calls that fail to validate or have an invalid token.
15
-
-[**Authenticated Parameters**][auth-params] replace the value of a parameter
16
-
with a field from an [OIDC][openid-claims] claim. Toolbox will automatically
17
-
resolve the ID token provided by the client and replace the parameter in the
18
-
tool call.
11
+
### 1. Toolbox Native Authorization
12
+
Used for specific tools to enforce authorization or resolve parameters:
13
+
-[**Authorized Invocation**][auth-invoke]: A tool is validated by the auth service before it can be invoked. Toolbox will reject any calls that fail to validate or have an invalid token.
14
+
-[**Authenticated Parameters**][auth-params]: Replaces the value of a parameter with a field from an [OIDC][openid-claims] claim. Toolbox will automatically resolve the ID token provided by the client and replace the parameter in the tool call.
15
+
16
+
### 2. MCP Authorization
17
+
Used to secure the entire MCP server. The Model Context Protocol supports [MCP Authorization](https://modelcontextprotocol.io/docs/tutorials/security/authorization) to secure interactions between clients and servers. When enabled, all MCP endpoints require a valid token, and you can enforce granular tool-level scope authorization. **Note that this mode is currently only supported when using the `generic` auth service type.**
Copy file name to clipboardExpand all lines: docs/en/documentation/configuration/authentication/generic.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,29 @@ scopesRequired:
158
158
> [!NOTE]
159
159
> If you are using Okta's Org Authorization Server (instead of a Custom Authorization Server), your `authorizationServer` URL will be `https://your-subdomain.okta.com`.
160
160
161
+
#### Tool-Level Scopes
162
+
163
+
When using MCP Authorization (with `mcpEnabled: true` in the auth service), you can enforce granular tool-level scope authorization by specifying the `scopesRequired` field in the tool configuration.
164
+
165
+
This ensures that a client can only invoke the tool if their authorization token contains all the specified scopes.
166
+
167
+
```yaml
168
+
kind: tool
169
+
name: update_flight_status
170
+
type: postgres-sql
171
+
source: my-pg-instance
172
+
statement: |
173
+
UPDATE flights SET status = $1 WHERE flight_number = $2
174
+
description: Update flight status
175
+
authRequired:
176
+
- my-generic-auth
177
+
scopesRequired:
178
+
- execute:sql
179
+
- write:flights
180
+
```
181
+
182
+
If a client attempts to invoke this tool without the required scopes, the server will return an HTTP 403 Forbidden response with a `WWW-Authenticate` header challenge indicating the missing scopes, as per the MCP Auth specification.
183
+
161
184
{{< notice tip >}} Use environment variable replacement with the format
162
185
${ENV_NAME} instead of hardcoding your secrets into the configuration file.
Copy file name to clipboardExpand all lines: docs/en/documentation/configuration/tools/_index.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,7 +260,13 @@ templateParameters:
260
260
| excludedValues |[]string | false | Input value will be checked against this field. Regex is also supported. |
261
261
| items | parameter object | true (if array) | Specify a Parameter object for the type of the values in the array (string only). |
262
262
263
-
## Authorized Invocations
263
+
## Tool-Level Scopes (MCP Authorization)
264
+
265
+
The Model Context Protocol supports [MCP Authorization](https://modelcontextprotocol.io/docs/tutorials/security/authorization) to secure interactions between clients and servers. When using MCP Authorization in Toolbox, you can enforce granular tool-level scope authorization by specifying the `scopesRequired` field in the tool configuration.
266
+
267
+
For detailed information on how to configure this and examples, please see the [Generic OIDC Auth](../authentication/generic.md#tool-level-scopes) documentation.
return&MCPAuthError{Code: http.StatusUnauthorized, Message: "authorization header must be in the format 'Bearer <token>'", ScopesRequired: a.ScopesRequired}
249
+
returnnil, &MCPAuthError{Code: http.StatusUnauthorized, Message: "authorization header must be in the format 'Bearer <token>'", ScopesRequired: a.ScopesRequired}
0 commit comments