К основному содержанию
команда CX Codex официальный · Anthropic

entra-app — команда для Claude Code: что делает и как установить

Команда entra-app для Claude Code описывает регистрацию приложения Microsoft Entra в собственном тенанте. Она помогает настроить вход для Outlook, шлюза, Foundry или sovereign cloud.

Apache-2.0 ★ 41 441 обновлён 2026-09-21

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add anthropics/financial-services
/plugin install claude-for-msft-365-install@claude-for-financial-services
Открыть на GitHub

Что делает entra-app

Команда объясняет, как зарегистрировать приложение Microsoft Entra в своём тенанте и настроить его для конфигураций, которым нужен собственный app registration. В ней разобраны redirect URI, разрешения API, admin consent и версия токена. Отдельные шаги описаны для Outlook, gateway, Foundry и Bedrock WIF.

Для backend приведены ожидаемые значения claims iss, aud и scp, а также адрес JWKS. Для GCC High, DoD и 21Vianet указаны порталы и authority для проверки токена. Регистрация требует доступа к Entra admin center или соответствующему порталу sovereign cloud.

Есть разбор ошибок AADSTS50011, AADSTS65001 и Tag: 9n156. Для Foundry direct нужны разрешение user_impersonation и роль Cognitive Services User на ресурсе.

Какие задачи решает

  • зарегистрировать собственное приложение Entra для входа в Outlook
  • настроить разрешения Graph и выдать admin consent
  • задать audience токена для собственного API или Foundry
  • подключить приложение в GCC High, DoD или 21Vianet
  • разобрать ошибки redirect URI и согласия

Примеры запросов агенту

  • Настрой регистрацию приложения Entra для Outlook и перечисли нужные разрешения Graph.
  • Объясни, как выставить entra_scope для моего API и проверить claims токена.
  • Подскажи, какие параметры нужны для Foundry direct в sovereign cloud.

Как установить entra-app

1Через маркетплейс плагинов

/plugin marketplace add anthropics/financial-services
/plugin install claude-for-msft-365-install@claude-for-financial-services

2Вручную: положить файлы

.claude/commands/entra-app.md

Вызов — /entra-app. Для всех проектов — ~/.claude/commands/

Вопросы об entra-app

Как установить entra-app в Claude Code?

Выполни /plugin marketplace add anthropics/financial-services, затем /plugin install claude-for-msft-365-install@claude-for-financial-services. Команда также доступна по пути .claude/commands/entra-app.md.

Что делает entra-app?

Команда описывает регистрацию приложения Microsoft Entra в собственном тенанте. Она охватывает redirect URI, разрешения, согласие администратора и проверку токенов для нескольких конфигураций.

Что нужно для работы entra-app?

Нужен доступ к своему тенанту Microsoft Entra и Entra admin center либо порталу соответствующего sovereign cloud. Для Foundry direct требуются разрешение user_impersonation и роль Cognitive Services User на ресурсе.

Исходный текст

entra-app.md · Apache-2.0
# Register your own Entra app

Several manifest configurations require an Entra (Azure AD) app registration in
**your** tenant rather than Anthropic's default multi-tenant app — because the
token's `aud` must match a resource you control, or because your tenant is in a
sovereign cloud where Anthropic's app doesn't exist. This page is the single
set of registration steps; the per-feature docs link here and tell you which
row of the permissions table applies.

You need this when setting any of:

| Manifest key | Why your own app |
|---|---|
| `graph_client_id` (Outlook) | Graph permissions are consented against your app, not Anthropic's |
| `entra_scope` | Access token must be audienced to *your* API resource |
| `gateway_auth_source=entra` | Your gateway — or a Foundry resource — validates a token audienced to that resource |
| `graph_cloud` ≠ `global` | Anthropic's app exists only in the commercial cloud |

## Register the app

In [Entra admin center](https://entra.microsoft.com) → *App registrations* →
*New registration*. Single-tenant. The simplest topology is one app acting as
both client (the add-in signs in as it) and resource (your backend validates
tokens audienced to it); split into two if your policy requires.

### 1. Redirect URIs

*Authentication* → *Add a platform* → **Single-page application** → add
**both**:

| URI | Used by |
|---|---|
| `brk-multihub://pivot.claude.ai` | [NAA broker](https://learn.microsoft.com/office/dev/add-ins/develop/enable-nested-app-authentication-in-your-add-in) — desktop Office and Outlook web. Missing this → `AADSTS50011` at sign-in. |
| `https://pivot.claude.ai/msal-redirect.html` | SPA fallback — Excel/Word/PowerPoint on Office for the web, which don't inject the NAA bridge. |

Both go under the SPA platform (not Web, not Mobile/desktop).

### 2. Permissions / API setup

What you configure here depends on what the token is for:

| Use case | Configure |
|---|---|
| **Outlook (Graph)** | *API permissions* → *Microsoft Graph* → Delegated → `Mail.ReadWrite`, `Calendars.Read`, `People.Read`, `User.Read`, `offline_access`. |
| **Gateway / bootstrap auth** (`entra_scope`, `gateway_auth_source=entra`) | *Expose an API* → set Application ID URI `api://<app-guid>` → *Add a scope* (e.g. `access_as_user`, admin-consent enabled). Then *API permissions* → *My APIs* → add that scope as a delegated permission (the app to itself, in single-app topology). |
| **Foundry direct, keyless** (`gateway_auth_source=entra` + `azure_resource_name`) | *API permissions* → *Azure Cognitive Services* → Delegated → `user_impersonation`. No *Expose an API* step — the token is audienced to Azure's `https://cognitiveservices.azure.com`, not your own app, so set `entra_scope=https://cognitiveservices.azure.com/.default`. Also grant each user the **Cognitive Services User** role on the Foundry resource (Azure Portal → resource → *Access control (IAM)*). |
| **Bedrock WIF** (`aws_role_arn`) | No API permissions needed — the ID token alone is the web identity. |

In all cases finish with *API permissions* → **Grant admin consent for
&lt;tenant&gt;**. Without it every user sees a consent prompt (or is blocked, if
user consent is disabled).

### 3. Token version

Only if you set up *Expose an API* above: in the app *Manifest*, set
`"accessTokenAcceptedVersion": 2`. Leave it unset and Entra issues v1.0 access
tokens (`iss` without `/v2.0`, no `preferred_username`), which most JWT
middleware rejects by default.

## What your backend validates

For `entra_scope` / `gateway_auth_source=entra`, the access token the add-in
sends as `Authorization: Bearer` carries:

| Claim | Expected |
|---|---|
| `iss` | `https://login.microsoftonline.com/<tenant-id>/v2.0` |
| `aud` | your Application ID URI (`api://<app-guid>`) |
| `scp` | the scope(s) you exposed, space-separated |
| JWKS | `https://login.microsoftonline.com/<tenant-id>/discovery/v2.0/keys` |

For **Foundry direct keyless** there is no backend of yours — Azure validates the
token. The `aud` is `https://cognitiveservices.azure.com` and `scp` is
`user_impersonation`; Azure checks the signature and audience, then authorizes
the call by the user's **Cognitive Services User** role on the resource. You do
not set *Expose an API* or `accessTokenAcceptedVersion` for this path.

The role is specifically **Cognitive Services User** — the data-plane role for
direct model inference. Not *Cognitive Services OpenAI User* (OpenAI models
only), and not *Foundry User* / *Azure AI User* (the renamed role for the Foundry
agent and project plane, a different data plane). The `user_impersonation`
permission is a delegated permission for the add-in's per-user interactive
sign-in; it is not a server-side on-behalf-of exchange, which Azure AI resources
do not support.

## GCC High / DoD / 21Vianet

Same steps, different portal and endpoints — apps don't replicate across
Microsoft national clouds.

- **Register at** [`portal.azure.us`](https://portal.azure.us) (US Gov) or
  [`portal.azure.cn`](https://portal.azure.cn) (21Vianet), not the commercial
  portal.
- **Redirect URIs** are unchanged — `brk-multihub://pivot.claude.ai` and
  `https://pivot.claude.ai/msal-redirect.html`. The add-in is served from the
  same domain in every cloud.
- **Manifest** — add `graph_cloud=us-gov-high` (or `us-gov-dod`, `china`) per
  the [sovereign clouds](manifest.md#sovereign--national-clouds-gcc-high-dod-21vianet)
  table.
- **Admin consent URL** uses the sovereign authority:
  `https://login.microsoftonline.us/<tenant-id>/adminconsent?client_id=<app-id>`
- **Backend validation** — the token's `iss` and JWKS use the `.us` host:
  `https://login.microsoftonline.us/<tenant-id>/v2.0` and
  `https://login.microsoftonline.us/<tenant-id>/discovery/v2.0/keys`. A
  validator pinned to `.com` rejects every request. The same applies to any AWS
  OIDC identity provider in the chain.

## Troubleshooting

**`AADSTS50011` (redirect URI mismatch)** — one of the two URIs above is
missing, or was added under the wrong platform (must be SPA).

**`Tag: 9n156` on Outlook for Mac** — the host's auth broker can't complete.
Almost always a sovereign-cloud account hitting an app registered in commercial
(fix: register in `portal.azure.us` and set `graph_cloud`). If the app is
already in the right cloud, check Conditional Access — the deprecated *Require
approved client app* grant blocks NAA. The Correlation Id in the dialog is
resolvable in your Entra sign-in logs, not Anthropic's.

**`AADSTS65001` (consent required)** — *Grant admin consent* wasn't clicked, or
a permission was added after consent was granted (re-grant).

© Anthropic · Apache-2.0 · anthropics/financial-services

Похожие слэш-команды

Все слэш-команды по теме «Облака: AWS, Azure, GCP» →
entra-app-registration Microsoft Скилл entra-app-registration для Claude Code проводит через регистрацию приложения в Microsoft Entra ID, настройку OAuth 2.0 и подключение MSAL. Охватывает настройку пользовательской и сервисной аутентификации. CX Codex +1 2установок saas-workspace-and-entra-unified-audit-forensics W4L33Dx Скилл saas-workspace-and-entra-unified-audit-forensics для Claude Code анализирует журналы Microsoft и Google при расследовании BEC и инцидентов в SaaS-тенанте. CX Codex +1 ★ 73звёзд репо azure-managed-grafana MicrosoftDocs Скилл помогает разбираться с настройкой и устранением проблем Azure Managed Grafana. Подключайте его, когда работаете с доступом, плагинами или интеграциями. CX Codex +1 171установок entra-agent-user официальный github Скилл entra-agent-user проводит агента через создание agent user в Microsoft Entra ID, чтобы он работал как цифровой сотрудник с почтой и Teams. CX Codex +1 8 600установок azure-container-apps MicrosoftDocs Помогает проектировать и развёртывать приложения в Azure Container Apps. Он также подсказывает, как разбирать сбои, настраивать сеть и масштабирование. CX Codex +1 1 400установок Microsoft 365 Mail mindstone MCP-сервер Microsoft 365 Mail подключает рабочую почту Outlook через Microsoft Graph. Помогает агенту читать цепочки писем, отвечать на сообщения и раскладывать переписку по папкам. CX Codex +1 ★ 14звёзд репо

Из того же набора116

Весь набор →
update-user-attrs Команда update-user-attrs для Claude Code задаёт пользовательские параметры через атрибуты расширения Microsoft Entra ID. Она обновляет значения в профиле одного пользователя или загружает их из CSV. CX Codex +1 ★ 41 441звёзд репо setup Команда setup настройки для Claude Code, проводящая администратора через подключение надстройки Claude Office к облачной инфраструктуре. CX Codex +1 ★ 41 441звёзд репо manifest Команда manifest для Claude Code собирает XML-манифест надстройки с настройками облачного провайдера. Для Outlook она выбирает отдельный шаблон, а перед развёртыванием требует согласия администратора Microsoft Graph. CX Codex +1 ★ 41 441звёзд репо export-data Команда export-data для Claude Code копирует локальную историю чатов, скиллы и настройки надстройки перед пересборкой машины. CX Codex +1 ★ 41 441звёзд репо debug Команда debug для Claude Code, диагностирующая ошибки развёртывания надстроек Excel, Word и PowerPoint. Применяется при сбоях подключения, неверных конфигурациях и отсутствии надстройки в приложении. CX Codex +1 ★ 41 441звёзд репо consent Команда consent для Claude Code подготавливает согласие администратора Azure для Entra SSO и доступа Outlook к Microsoft Graph. Администратор арендатора открывает ссылку и подтверждает разрешения. CX Codex +1 ★ 41 441звёзд репо bootstrap Команда bootstrap для Claude Code, которая настраивает endpoint для динамической конфигурации и управления серверами MCP. Запускается при инициализации расширения для загрузки параметров пользователей. CX Codex +1 ★ 41 441звёзд репо access-policies Помогает собрать конфигурацию access_policies в формате IAM. Администратор настраивает правила доступа надстройки к файлам с метками конфиденциальности. CX Codex +1 ★ 41 441звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой