メインコンテンツへスキップ

スタートガイド

GitHub

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.

手動セットアップを希望する場合は、以下のコマンドを実行してプラグインをインストールし、下記のプラットフォーム別の手順に従ってください:

  1. パッケージをインストール

    ターミナル
    bun add @capgo/capacitor-intune
  2. ネイティブプロジェクトを同期

    ターミナル
    bunx cap sync
  3. ネイティブ Intune セットアップの完了 専用の iOSの設定 と Androidの設定 ページに従ってください。Intune では、ブローカー認証、リダイレクト URI、マニフェスト、エンタイトルメント、MSAL 設定のために、ホストアプリのネイティブ設定が必要です。

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });
// The result holds sensitive values: use it without logging it.
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.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });
  • リスナー: 画面がアンマウントされたらハンドルを削除します。
  • ネイティブ同期: 実行 bunx cap sync プラグインのアップグレード後。
  • 信頼できる情報源: 信頼 src/definitions.ts GitHub リポジトリ内。
  • 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.

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 });
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' });
  • acquireToken(options): Microsoft サインインを開始し、トークンとアカウントのメタデータを返します。
  • acquireTokenSilent(options): 既存アカウントのキャッシュ済みトークンを読み取ります。
  • registerAndEnrollAccount(options): MSAL アカウントを Intune に登録し、エンロールメントをトリガーします。
  • loginAndEnrollAccount()Intune がログインと登録フローを制御します。
  • appConfig(user)アカウントの Intune アプリ設定値を読み取ります。
  • getPolicy(user)アカウントの現在の Intune アプリ保護ポリシーを読み取ります。
  • groupName(user): 共通の GroupName config ヘルパー値が存在する場合に読み取ります。
  • 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 のプロダクトワークフロー向けに。