Skip to content

docs: expand auth.mdx with engine-specific sections, quick-reference table, and troubleshooting#25172

Merged
pelikhan merged 2 commits intomainfrom
copilot/expand-auth-mdx-provider-oauth
Apr 7, 2026
Merged

docs: expand auth.mdx with engine-specific sections, quick-reference table, and troubleshooting#25172
pelikhan merged 2 commits intomainfrom
copilot/expand-auth-mdx-provider-oauth

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

auth.mdx only documented the API key method per engine with no coverage of OAuth alternatives, custom endpoints, or common auth failures. CLAUDE_CODE_OAUTH_TOKEN appeared in user questions but was entirely undocumented.

Changes

  • Quick-reference table — engine → required secret → alternative → notes, at the top of the page so users find the answer immediately

  • Engine-specific expansions:

    • Copilot — documents GITHUB_COPILOT_BASE_URL for custom/proxy endpoints; clarifies PAT-only requirement (no GitHub Apps, no OAuth)
    • Claude — adds ANTHROPIC_BASE_URL custom endpoint guidance; explicit CLAUDE_CODE_OAUTH_TOKEN subsection stating it is not supported and ANTHROPIC_API_KEY is the only valid auth method
    • Codex — documents CODEX_API_KEY runtime fallback precedence; adds Azure OpenAI / custom LLM router example using OPENAI_BASE_URL with proper secret referencing
    • Gemini — no changes needed
  • Troubleshooting auth errors section — covers 401/403 errors for all four engines, Copilot license/inference access failures, and GHES 400 Bad Request, each with the direct fix or link to the relevant checklist

…e, CLAUDE_CODE_OAUTH_TOKEN docs, and troubleshooting

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f0876716-b750-4880-b124-1adc7b474341

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Expand auth.mdx to cover provider-based and OAuth authentication docs: expand auth.mdx with engine-specific sections, quick-reference table, and troubleshooting Apr 7, 2026
Copilot AI requested a review from pelikhan April 7, 2026 22:03
@pelikhan pelikhan marked this pull request as ready for review April 7, 2026 22:07
Copilot AI review requested due to automatic review settings April 7, 2026 22:07
@pelikhan pelikhan merged commit 2927b21 into main Apr 7, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/expand-auth-mdx-provider-oauth branch April 7, 2026 22:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Expands the authentication reference to make engine-specific secrets, custom endpoints, and common auth failures easier to understand and troubleshoot.

Changes:

  • Adds a top-of-page quick-reference table mapping engine → required secret (and alternatives).
  • Expands engine sections with custom endpoint environment variables and clarifies supported auth methods (notably CLAUDE_CODE_OAUTH_TOKEN is not supported).
  • Adds a consolidated “Troubleshooting auth errors” section covering common 401/403/400 scenarios.
Show a summary per file
File Description
docs/src/content/docs/reference/auth.mdx Adds quick secret lookup, engine-specific endpoint/auth notes, and an auth troubleshooting section.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 4

## Which secret do I need?

You will need one of the following GitHub Actions secrets configured in your repository to authenticate the AI engine you choose:
Configure one GitHub Actions secret per engine before running your first workflow:
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The wording here can be read as “configure one secret for each engine”, which implies users need to set up all four secrets before their first run. Since a workflow uses only the selected engine:, consider rephrasing to “Configure the GitHub Actions secret for the engine you plan to use…” (or similar) to avoid confusion.

Suggested change
Configure one GitHub Actions secret per engine before running your first workflow:
Configure the GitHub Actions secret for the engine you plan to use before running your first workflow:

Copilot uses AI. Check for mistakes.
Comment on lines +147 to +151
**Azure OpenAI and custom endpoints**:

To use Azure OpenAI or an internal LLM router instead of the default OpenAI endpoint, set `OPENAI_BASE_URL` in `engine.env` and store the corresponding key as a GitHub Actions secret referenced from `engine.env`:

```aw wrap
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

This section is titled “Azure OpenAI and custom endpoints”, but the example only changes OPENAI_BASE_URL. For direct Azure OpenAI usage, users typically also need Azure-specific request shaping (deployment path template and api-version query), which is documented elsewhere (e.g., docs/src/content/docs/reference/glossary.md shows an azure-openai provider with request.path-template and request.query.api-version). Consider clarifying that the OPENAI_BASE_URL approach assumes an OpenAI-compatible gateway/router, or add a link/brief note pointing readers to the inline provider configuration required for native Azure OpenAI.

Copilot uses AI. Check for mistakes.

**`403 "Resource not accessible by personal access token"` (Copilot)**

The PAT is missing the required permission. Use a fine-grained PAT with **Account permissions → Copilot Requests: Read**. The resource owner must be your personal account, not an organization. See [`COPILOT_GITHUB_TOKEN`](#copilot_github_token) for the setup link.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

This troubleshooting guidance conflicts with docs/src/content/docs/troubleshooting/common-issues.md (“Copilot GHES: Common Error Messages”), which also documents classic PATs with the copilot scope as an option for this error. Consider either mentioning the classic PAT alternative here as well, or linking directly to the existing troubleshooting entry to keep the guidance consistent.

Suggested change
The PAT is missing the required permission. Use a fine-grained PAT with **Account permissions → Copilot Requests: Read**. The resource owner must be your personal account, not an organization. See [`COPILOT_GITHUB_TOKEN`](#copilot_github_token) for the setup link.
The PAT is missing the required permission. Use either a fine-grained PAT with **Account permissions → Copilot Requests: Read** (with your personal account as the resource owner, not an organization) or a classic PAT with the `copilot` scope. See [`COPILOT_GITHUB_TOKEN`](#copilot_github_token) for the setup link.

Copilot uses AI. Check for mistakes.

**`401 Unauthorized` or `403 Forbidden` (Claude)**

The `ANTHROPIC_API_KEY` secret is missing, expired, or invalid. Verify the key is active in the [Anthropic Console](https://console.anthropic.com/). Re-set the secret with `gh aw secrets set ANTHROPIC_API_KEY --value "<key>"`. Also check that you have not accidentally set `CLAUDE_CODE_OAUTH_TOKEN` instead — it is not supported.
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

Spelling: “Re-set the secret” is usually written as “Reset the secret”.

Suggested change
The `ANTHROPIC_API_KEY` secret is missing, expired, or invalid. Verify the key is active in the [Anthropic Console](https://console.anthropic.com/). Re-set the secret with `gh aw secrets set ANTHROPIC_API_KEY --value "<key>"`. Also check that you have not accidentally set `CLAUDE_CODE_OAUTH_TOKEN` instead — it is not supported.
The `ANTHROPIC_API_KEY` secret is missing, expired, or invalid. Verify the key is active in the [Anthropic Console](https://console.anthropic.com/). Reset the secret with `gh aw secrets set ANTHROPIC_API_KEY --value "<key>"`. Also check that you have not accidentally set `CLAUDE_CODE_OAUTH_TOKEN` instead — it is not supported.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Expand auth.mdx to cover provider-based and OAuth authentication for all engines

3 participants