Skip to content

update mcp-gateway authn/authz guides#110677

Open
Patryk-Stefanski wants to merge 1 commit intoopenshift:mcp-gateway-docs-tpfrom
Patryk-Stefanski:fix-auth-authz-docs
Open

update mcp-gateway authn/authz guides#110677
Patryk-Stefanski wants to merge 1 commit intoopenshift:mcp-gateway-docs-tpfrom
Patryk-Stefanski:fix-auth-authz-docs

Conversation

@Patryk-Stefanski
Copy link
Copy Markdown

@Patryk-Stefanski Patryk-Stefanski commented Apr 23, 2026

@openshift-ci openshift-ci Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 23, 2026
@ocpdocs-previewbot
Copy link
Copy Markdown

ocpdocs-previewbot commented Apr 23, 2026

Signed-off-by: Patryk Stefanski <pstefans@redhat.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 23, 2026

@Patryk-Stefanski: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

+
[source,json,subs="+quotes"]
----
$ oc patch gateway _<mcp_gateway>_ -n _<gateway_system>_ --type json -p '[
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this section, lines 44-50 in the install doc be updated to match this?

  • we can make the listener a prereq to this procedure
  • add a note to the install doc that you need to config this listener to create authorization
  • then we can remove the step from this procedure

WDYT?

----
+
* The `"mcp-ns/arithmetic-mcp-server"` specification must match the namespaced name of the `MCPServerRegistration` CR.
* 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` is named `arithmetic-mcp-server` in the `mcp-ns` namespace, the {keycloak} client ID must be `mcp-ns/arithmetic-mcp-server`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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` is named `arithmetic-mcp-server` in the `mcp-ns` namespace, the {keycloak} client ID must be `mcp-ns/arithmetic-mcp-server`.
* 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`.

+
[IMPORTANT]
====
The authorization `AuthPolicy` must target the `mcps` listener, not the `mcp` listener. The `mcp` listener handles public traffic (`initialize`, `tools/list`, `/.well-known`) and has the authentication-only `AuthPolicy`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The authorization `AuthPolicy` must target the `mcps` listener, not the `mcp` listener. The `mcp` listener handles public traffic (`initialize`, `tools/list`, `/.well-known`) and has the authentication-only `AuthPolicy`.
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 `spec.targetRef.name:` with the name of the `Gateway` CR.
* The `spec.targetRef.sectionName:` value targets the MCP server listener.
* Authentication: Validates the JWT token using the configured issuer URL
* The `spec.targetRef.sectionName:` value must be `mcps`, the internal listener for tool-call authorization. This listener must exist on your `Gateway` object.
Copy link
Copy Markdown
Contributor

@ShaunaDiaz ShaunaDiaz Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The `spec.targetRef.sectionName:` value must be `mcps`, the internal listener for tool-call authorization. This listener must exist on your `Gateway` object.
* 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.

----
$ oc apply -f _<mcp_tool_auth_policy.yaml>_
$ oc apply -f - <<EOF
<AuthPolicy CR from the previous step>
Copy link
Copy Markdown
Contributor

@ShaunaDiaz ShaunaDiaz Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<AuthPolicy CR from the previous step>
_<mcp_tool_auth_policy.yaml>_

user-replaceable values can only look like this
I also don't think the EOF works when we separate file creation from application? (having the yaml in one step and application of the resource in a second step is preferred in docs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants