スタートガイド
インストール手順と、このプラグインの完全なMarkdownガイドを含むセットアッププロンプトをコピーします。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intune`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/intune/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」セクションAIアシストによるセットアップでプラグインをインストールできます。以下のコマンドを使用して、お使いのAIツールに Capgo のスキルを追加してください:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用します:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intune` plugin in my project.手動セットアップを希望する場合は、以下のコマンドを実行してプラグインをインストールし、下記のプラットフォーム別の手順に従ってください:
-
パッケージをインストール
ターミナル bun add @capgo/capacitor-intune -
ネイティブプロジェクトを同期
ターミナル bunx cap sync -
Intuneのネイティブ設定を完了する 専用の iOSの設定 と Androidの設定 ページに従ってください。ブローカー認証、リダイレクトURI、マニフェスト、Entitlements、およびMSALの設定には、引き続きホストアプリ側のネイティブ構成が必要です。
クイックスタート
「クイックスタート」セクションimport { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });// The result holds sensitive values: use it without logging it.例: acquireTokenSilent
「Example: acquireTokenSilent」セクションimport { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireTokenSilent({ scopes: ['openid'], accountId: 'acquireToken',});// The result holds sensitive values: use it without logging it.例: registerAndEnrollAccount
「Example: registerAndEnrollAccount」セクションimport { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });よくある落とし穴
「よくある落とし穴」セクション- リスナー: 画面がアンマウントされたらハンドルを削除します。
- ネイティブ同期: 実行
bunx cap syncプラグインのアップグレード後。 - 信頼できる情報源: 信頼
src/definitions.tsGitHub リポジトリ内。
- Capacitor 8+
- Intuneを使用したAndroid向け SDK
12.0.3 - Intuneを使用したiOS向け SDK
21.5.1 - iOS デプロイメントターゲット
17.0+
IonicのIntuneドキュメントでは、Xcode 26でビルドされたアプリには2026年1月19日の期限が設定されており、Intune iOS SDK が必要であると記載されています 21.1.0+. このプラグインでは既に以下を使用しています: 21.5.1.
基本的な使い方
「Basic Usage」セクションimport { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.addListener('appConfigChange', (result) => { console.log('App config changed', result.accountId);});
await IntuneMAM.addListener('policyChange', (result) => { console.log('Policy changed', result.accountId);});
const auth = await IntuneMAM.acquireToken({ scopes: ['https://graph.microsoft.com/.default'], loginHint: 'alex@example.com',});
await IntuneMAM.registerAndEnrollAccount({ accountId: auth.accountId,});
const appConfig = await IntuneMAM.appConfig({ accountId: auth.accountId,});
const policy = await IntuneMAM.getPolicy({ accountId: auth.accountId,});
console.log({ auth, appConfig, policy });よくあるフロー
「Common Flows」セクション対話型サインインと登録
「Interactive sign-in and enrollment」セクションconst auth = await IntuneMAM.acquireToken({ scopes: ['https://graph.microsoft.com/.default'],});
await IntuneMAM.registerAndEnrollAccount({ accountId: auth.accountId,});サイレントなトークンリフレッシュ
「Silent token refresh」セクションconst token = await IntuneMAM.acquireTokenSilent({ accountId: 'AAD_OBJECT_ID', scopes: ['https://graph.microsoft.com/.default'], forceRefresh: true,});登録済みアカウントの読み取り
「登録済みアカウントの読み取り」セクションconst user = await IntuneMAM.enrolledAccount();サインアウトまたは選択的なワイプ
「サインアウトまたは選択的なワイプ」セクションawait IntuneMAM.logoutOfAccount({ accountId: 'AAD_OBJECT_ID' });await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'AAD_OBJECT_ID' });API の概要
「API の概要」セクションacquireToken(options): Microsoftへのサインインを開始し、トークンとアカウントのメタデータを返します。acquireTokenSilent(options): 既存アカウントのキャッシュされたトークンを読み取ります。registerAndEnrollAccount(options): MSALアカウントをIntuneに登録し、エンロールメントを開始します。loginAndEnrollAccount(): Intuneによるログインおよびエンロールメントフローに従います。appConfig(user): アカウントのIntuneアプリ設定値を読み取ります。getPolicy(user): アカウントに適用されている現在のIntuneアプリ保護ポリシーを読み取ります。groupName(user): 共通のGroupNameconfig helper値が存在する場合に読み取ります。sdkVersion(): バンドルされているIntuneおよびMSALのバージョンを確認します。
プラットフォームに関する注意点
「プラットフォームに関する注意事項」セクション- Webはサポートされていません。
- iOSとAndroidの両方で、以下の設定に加えてネイティブプロジェクトの設定が必要です:
cap sync. - Azureの登録、Intuneポリシーの割り当て、リダイレクトURI、およびエンタイトルメントは、アプリごとに設定する必要があります。
Getting Startedの続きを進める
「Getting Started からの続き」セクション使用している場合 スタートガイド 移行とエンタープライズ運用を計画するには、次と連携してください @capgo/capacitor-intuneの使用方法 @capgo/capacitor-intune の使用におけるネイティブ機能について、 Capgo エンタープライズ Capgo Enterprise のプロダクトワークフロー向けに、 Ionic Enterprise プラグインの代替案 Ionic Enterprise Plugin Alternatives のプロダクトワークフロー向けに、 Capgo の代替案 Capgo Alternatives のプロダクトワークフロー向け、および Capgo コンサルティング Capgo Consulting のプロダクトワークフロー向けに。