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
@@ -14,9 +13,10 @@ The following example demonstrates using a Kuadrant `AuthPolicy` custom resource
14
13
15
14
* You installed {mcpg}.
16
15
* You installed {prodname}.
17
-
* You configured a `Gateway` object.
18
-
* You completed authentication procedures.
16
+
* You configured a `Gateway` object with an `mcp` listener and an `mcps` listener. The `mcps` listener is required for internal `tools/call` routing and authorization.
17
+
* You completed authentication procedures, including creating an `AuthPolicy` CR on the `mcp` listener.
19
18
* You configured your identity provider to include `group` and `role` claims in JSON Web Tokens (JWT).
19
+
* The identity provider client IDs match the namespaced `MCPServerRegistration` name in the format `_<namespace>_/_<mcpserverregistration_name>_`.
20
20
21
21
.Procedure
22
22
@@ -37,10 +37,15 @@ The following example demonstrates using a Kuadrant `AuthPolicy` custom resource
37
37
}
38
38
----
39
39
+
40
-
* The `"mcp-ns/arithmetic-mcp-server"` specification must match the namespaced name of the `MCPServerRegistration` CR.
40
+
* The `"mcp-ns/arithmetic-mcp-server"` specification must match the namespaced name of the `MCPServerRegistration` CR in the format `{namespace}/{name}`. For example, if your `MCPServerRegistration` CR is named `arithmetic-mcp-server` and is applied in the `mcp-ns` namespace, the {keycloak} client ID must be `mcp-ns/arithmetic-mcp-server`.
41
41
* The `"roles": ["add", "sum", "multiply", "divide"]` parameter and values specify the roles representing the allowed tools.
42
42
43
-
. Configure tool-level authorization by creating an `AuthPolicy` CR that enforces tool-level access control, as shown in the following example:
43
+
. Configure tool-level authorization by creating an `AuthPolicy` CR that enforces tool-level access control on the `mcps` listener, as shown in the following example:
44
+
+
45
+
[IMPORTANT]
46
+
====
47
+
The authorization `AuthPolicy` CR must target the `mcps` listener, not the `mcp` listener. The `mcp` listener only handles public traffic and has an authentication-only `AuthPolicy` CR.
* Replace `metadata.name:` with the name of the `AuthPolicy`.
91
96
* Replace `metadata.namespace:` with the namespace where the `AuthPolicy` CR is applied.
92
97
* Replace `spec.targetRef.name:` with the name of the `Gateway` CR.
93
-
* The `spec.targetRef.sectionName:` value targets the MCP server listener.
94
-
* Authentication: Validates the JWT token using the configured issuer URL
98
+
* The `spec.targetRef.sectionName:` value must be `mcps`, which is the internal listener for `tool/call` authorization. This listener must exist on your `Gateway` object.
99
+
* Authentication: Validates the JWT token using the configured issuer URL. Replace `_<keycloak.example.com>_` with your identity provider hostname.
95
100
* Authorization Logic: CEL expression checks if user's roles allow access to the requested tool
96
101
* CEL Breakdown:
97
102
**`request.headers['x-mcp-toolname']`: The name of the requested MCP tool, stripped from prefix.
0 commit comments