jpskill.com
🛠️ 開発・MCP コミュニティ

entra-app-registration

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Azure RBAC or role assignments (use azure-rbac), Key Vault secrets (use azure-keyvault-expiration-audit), Azure resource security (use azure-security).

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o entra-app-registration.zip https://jpskill.com/download/19683.zip && unzip -o entra-app-registration.zip && rm entra-app-registration.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19683.zip -OutFile "$d\entra-app-registration.zip"; Expand-Archive "$d\entra-app-registration.zip" -DestinationPath $d -Force; ri "$d\entra-app-registration.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して entra-app-registration.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → entra-app-registration フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
16

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

概要

Microsoft Entra ID (旧 Azure Active Directory) は、Microsoft のクラウドベースの ID およびアクセス管理サービスです。アプリ登録により、アプリケーションはユーザーを認証し、Azure リソースに安全にアクセスできます。

主要な概念

概念 説明
アプリ登録 アプリが Microsoft ID プラットフォームを使用できるようにする構成
アプリケーション (クライアント) ID アプリケーションの一意の識別子
テナント ID Azure AD テナント/ディレクトリの一意の識別子
クライアント シークレット アプリケーションのパスワード (機密クライアントのみ)
リダイレクト URI 認証応答が送信される URL
API アクセス許可 アプリが要求するアクセス スコープ
サービス プリンシパル アプリを登録したときにテナントで作成される ID

アプリケーションの種類

種類 ユースケース
Web アプリケーション サーバーサイド アプリ、API
シングルページ アプリ (SPA) JavaScript/React/Angular アプリ
モバイル/ネイティブ アプリ デスクトップ、モバイル アプリ
デーモン/サービス バックグラウンド サービス、API

コア ワークフロー

ステップ 1: アプリケーションを登録する

Azure ポータルまたは Azure CLI を使用してアプリ登録を作成します。

ポータルでの方法:

  1. Azure ポータル → Microsoft Entra ID → アプリ登録 に移動します
  2. 「新規登録」をクリックします
  3. 名前、サポートされているアカウントの種類、およびリダイレクト URI を入力します
  4. 「登録」をクリックします

CLI での方法: references/cli-commands.md を参照してください IaC での方法: references/BICEP-EXAMPLE.bicep を参照してください

プロジェクトで既に IaC を使用している場合、多数のアプリ登録を管理するためのスケーラブルなソリューションが必要な場合、または構成変更のきめ細かな監査履歴が必要な場合は、IaC を使用して Entra アプリ登録を管理することを強くお勧めします。

ステップ 2: 認証を構成する

アプリケーションの種類に基づいて認証設定を行います。

  • Web アプリ: リダイレクト URI を追加し、必要に応じて ID トークンを有効にします
  • SPA: リダイレクト URI を追加し、必要に応じて暗黙的な許可フローを有効にします
  • モバイル/デスクトップ: http://localhost またはカスタム URI スキームを使用します
  • サービス: クライアント資格情報フローにはリダイレクト URI は不要です

ステップ 3: API アクセス許可を構成する

アプリケーションに Microsoft API または独自の API にアクセスするアクセス許可を付与します。

一般的な Microsoft Graph アクセス許可:

  • User.Read - ユーザー プロファイルの読み取り
  • User.ReadWrite.All - すべてのユーザーの読み取りと書き込み
  • Directory.Read.All - ディレクトリ データの読み取り
  • Mail.Send - ユーザーとしてメールを送信

詳細: references/api-permissions.md を参照してください

ステップ 4: クライアント資格情報を作成する (必要な場合)

機密クライアント アプリケーション (Web アプリ、サービス) の場合は、クライアント シークレット、証明書、またはフェデレーション ID 資格情報を作成します。

クライアント シークレット:

  • 「証明書とシークレット」に移動します
  • 新しいクライアント シークレットを作成します
  • 値をすぐにコピーします (一度しか表示されません)
  • 安全に保管します (Key Vault を推奨)

証明書: 実稼働環境では、セキュリティ強化のため、シークレットの代わりに証明書を使用します。「証明書とシークレット」セクションから証明書をアップロードします。

フェデレーション ID 資格情報: 機密クライアントを Entra プラットフォームに動的に認証するために使用します。

ステップ 5: OAuth フローを実装する

OAuth フローをアプリケーション コードに統合します。

参照:

一般的なパターン

パターン 1: 初めてのアプリ登録

ユーザーに初めてのアプリ登録を段階的に案内します。

必要な情報:

  • アプリケーション名
  • アプリケーションの種類 (Web、SPA、モバイル、サービス)
  • リダイレクト URI (該当する場合)
  • 必要なアクセス許可

スクリプト: references/first-app-registration.md を参照してください

パターン 2: ユーザー認証付きコンソール アプリケーション

ユーザーを認証する .NET/Python/Node.js コンソール アプリを作成します。

必要な情報:

  • プログラミング言語 (C#、Python、JavaScript など)
  • 認証ライブラリ (MSAL を推奨)
  • 必要なアクセス許可

例: references/console-app-example.md を参照してください

パターン 3: サービス間認証

ユーザー操作なしでデーモン/サービス認証を設定します。

必要な情報:

  • サービス/アプリ名
  • ターゲット API/リソース
  • シークレットまたは証明書を使用するかどうか

実装: クライアント資格情報フローを使用します (references/oauth-flows.md#client-credentials-flow を参照してください)

MCP ツールと CLI

Azure CLI コマンド

コマンド 目的
az ad app create 新しいアプリ登録を作成する
az ad app list アプリ登録を一覧表示する
az ad app show アプリの詳細を表示する
az ad app permission add API アクセス許可を追加する
az ad app credential reset 新しいクライアント シークレットを生成する
az ad sp create サービス プリンシパルを作成する

完全なリファレンス: references/cli-commands.md を参照してください

Microsoft Authentication Library (MSAL)

MSAL は、Microsoft ID プラットフォームを統合するための推奨ライブラリです。

サポートされている言語:

  • .NET/C# - Microsoft.Identity.Client
  • JavaScript/TypeScript - @azure/msal-browser, @azure/msal-node
  • Python - msal

例: references/console-app-example.md を参照してください

セキュリティのベスト プラクティス

プラクティス 推奨事項
シークレットをハードコードしない 環境変数、Azure Key Vault、またはマネージド ID を使用する
シークレットを定期的にローテーションする 有効期限を設定し、ローテーションを自動化する
シークレットよりも証明書を使用する 実稼働環境ではより安全
最小特権のアクセス許可 必要な API アクセス許可のみを要求する
MFA を有効にする ユーザーに多要素認証を要求する
マネージド ID を使用する Azure ホスト型アプリの場合、シークレットを回避する

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Overview

Microsoft Entra ID (formerly Azure Active Directory) is Microsoft's cloud-based identity and access management service. App registrations allow applications to authenticate users and access Azure resources securely.

Key Concepts

Concept Description
App Registration Configuration that allows an app to use Microsoft identity platform
Application (Client) ID Unique identifier for your application
Tenant ID Unique identifier for your Azure AD tenant/directory
Client Secret Password for the application (confidential clients only)
Redirect URI URL where authentication responses are sent
API Permissions Access scopes your app requests
Service Principal Identity created in your tenant when you register an app

Application Types

Type Use Case
Web Application Server-side apps, APIs
Single Page App (SPA) JavaScript/React/Angular apps
Mobile/Native App Desktop, mobile apps
Daemon/Service Background services, APIs

Core Workflow

Step 1: Register the Application

Create an app registration in the Azure portal or using Azure CLI.

Portal Method:

  1. Navigate to Azure Portal → Microsoft Entra ID → App registrations
  2. Click "New registration"
  3. Provide name, supported account types, and redirect URI
  4. Click "Register"

CLI Method: See references/cli-commands.md IaC Method: See references/BICEP-EXAMPLE.bicep

It's highly recommended to use the IaC to manage Entra app registration if you already use IaC in your project, need a scalable solution for managing lots of app registrations or need fine-grained audit history of the configuration changes.

Step 2: Configure Authentication

Set up authentication settings based on your application type.

  • Web Apps: Add redirect URIs, enable ID tokens if needed
  • SPAs: Add redirect URIs, enable implicit grant flow if necessary
  • Mobile/Desktop: Use http://localhost or custom URI scheme
  • Services: No redirect URI needed for client credentials flow

Step 3: Configure API Permissions

Grant your application permission to access Microsoft APIs or your own APIs.

Common Microsoft Graph Permissions:

  • User.Read - Read user profile
  • User.ReadWrite.All - Read and write all users
  • Directory.Read.All - Read directory data
  • Mail.Send - Send mail as a user

Details: See references/api-permissions.md

Step 4: Create Client Credentials (if needed)

For confidential client applications (web apps, services), create a client secret, certificate or federated identity credential.

Client Secret:

  • Navigate to "Certificates & secrets"
  • Create new client secret
  • Copy the value immediately (only shown once)
  • Store securely (Key Vault recommended)

Certificate: For production environments, use certificates instead of secrets for enhanced security. Upload certificate via "Certificates & secrets" section.

Federated Identity Credential: For dynamically authenticating the confidential client to Entra platform.

Step 5: Implement OAuth Flow

Integrate the OAuth flow into your application code.

See:

Common Patterns

Pattern 1: First-Time App Registration

Walk user through their first app registration step-by-step.

Required Information:

  • Application name
  • Application type (web, SPA, mobile, service)
  • Redirect URIs (if applicable)
  • Required permissions

Script: See references/first-app-registration.md

Pattern 2: Console Application with User Authentication

Create a .NET/Python/Node.js console app that authenticates users.

Required Information:

  • Programming language (C#, Python, JavaScript, etc.)
  • Authentication library (MSAL recommended)
  • Required permissions

Example: See references/console-app-example.md

Pattern 3: Service-to-Service Authentication

Set up daemon/service authentication without user interaction.

Required Information:

  • Service/app name
  • Target API/resource
  • Whether to use secret or certificate

Implementation: Use Client Credentials flow (see references/oauth-flows.md#client-credentials-flow)

MCP Tools and CLI

Azure CLI Commands

Command Purpose
az ad app create Create new app registration
az ad app list List app registrations
az ad app show Show app details
az ad app permission add Add API permission
az ad app credential reset Generate new client secret
az ad sp create Create service principal

Complete reference: See references/cli-commands.md

Microsoft Authentication Library (MSAL)

MSAL is the recommended library for integrating Microsoft identity platform.

Supported Languages:

  • .NET/C# - Microsoft.Identity.Client
  • JavaScript/TypeScript - @azure/msal-browser, @azure/msal-node
  • Python - msal

Examples: See references/console-app-example.md

Security Best Practices

Practice Recommendation
Never hardcode secrets Use environment variables, Azure Key Vault, or managed identity
Rotate secrets regularly Set expiration, automate rotation
Use certificates over secrets More secure for production
Least privilege permissions Request only required API permissions
Enable MFA Require multi-factor authentication for users
Use managed identity For Azure-hosted apps, avoid secrets entirely
Validate tokens Always validate issuer, audience, expiration
Use HTTPS only All redirect URIs must use HTTPS (except localhost)
Monitor sign-ins Use Entra ID sign-in logs for anomaly detection

SDK Quick References

References

External Resources

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。