> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/mcp-integration-contributor-guide/authentication-patterns.md).

# Authentication patterns

MCP integrations can use either token/bearer authentication or OAuth authorization codes, based on the vendor's required authentication method.

#### Token/bearer authentication <a href="#uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585299009278" id="uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585299009278"></a>

Use when the vendor provides a static token or API key. The user configures the token, and the integration uses it for all requests. test-module works directly with `client.test_connection()`. For an example, see `Packs/GitHubMCP/Integrations/GitHubMCP` .

#### OAuth authorization code <a href="#uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585306759908" id="uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585306759908"></a>

Use when the vendor requires user authorization via OAuth. The user runs `generate-login-url` to get an authorization URL, authorizes the integration, and provides the authorization code. `test-module` raises an exception directing users to use `auth-test` instead. For an example, see `Packs/CloudFlareMCP/Integrations/CloudFlareMCP` .

#### OAuth dynamic client registration <a href="#uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585310100004" id="uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585310100004"></a>

Use when the vendor supports automatic client registration. This option is similar to OAuth authorization code, but the Client class handles registration automatically. For an example, see `Packs/AtlassianCloudMCP/Integrations/AtlassianCloudMCP` .

#### Multiple auth types (generic) <a href="#uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585312129174" id="uuid-ad0bde03-1a07-43a7-4909-b76c85a01f25_bridgehead-id235585312129174"></a>

Use when you need to support multiple authentication methods in a single integration. Include an `auth_type` dropdown parameter and validate that required parameters are present for the selected auth type.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/mcp-integration-contributor-guide/authentication-patterns.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
