> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
