スタートガイド
インストール手順と、このプラグインの完全な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`, `@capgo/capacitor-persona`
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/persona/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-intunebunx cap syncインポート
「インポート」セクションimport { IntuneMAM } from '@capgo/capacitor-intune';クイックスタート
「クイックスタート」セクションimport { Persona } from '@capgo/capacitor-persona';
await Persona.startInquiry({});よくある落とし穴
「よくある落とし穴」セクション- リスナー: 画面がアンマウントされたらハンドルを削除します。
- ネイティブ同期: 実行
bunx cap syncプラグインのアップグレード後。 - 信頼できる情報源: 信頼
src/definitions.tsGitHub リポジトリ内。
API の概要
「API 概要」セクションacquireToken
「acquireToken」セクションMicrosoftのサインインフローを表示し、アクセストークンとアカウントのメタデータを返します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });// The result holds sensitive values: use it without logging it.acquireTokenSilent
「acquireTokenSilent」セクション以前にサインインしたユーザーのMSALキャッシュからトークンを取得します。
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
「registerAndEnrollAccount」セクション以前に認証されたアカウントをIntuneに登録し、登録を開始します。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });loginAndEnrollAccount
「loginAndEnrollAccount」セクションアプリのトークンを先に要求せずに、Intuneにユーザーの認証と登録を依頼します。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
「enrolledAccount」セクション現在登録されているIntuneアカウントがあれば返します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();console.log(result);deRegisterAndUnenrollAccount
「deRegisterAndUnenrollAccount」セクションIntuneからアカウントの登録を解除し、必要に応じてセレクティブワイプを実行します。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });logoutOfAccount
「logoutOfAccount」セクションIntuneアカウントの登録を解除せずに、MSALからユーザーをサインアウトします。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });appConfig
「appConfig」セクション管理対象アカウントのリモートIntuneアプリ構成を取得します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });console.log(result);getPolicy
「getPolicy」セクション管理対象アカウントに対して現在有効な Intune アプリ保護ポリシーを取得します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });console.log(result);groupName
「groupName」セクションアプリ設定値が存在する場合に、それを解決する GroupName 便利なヘルパー関数です。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });console.log(result);sdkVersion
「sdkVersion」セクションこのプラグインに同梱されたネイティブ Intune および MSAL SDK のバージョンを返します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();console.log(result);displayDiagnosticConsole
「displayDiagnosticConsole」セクションネイティブの Intune 診断 UI を表示します。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();型リファレンス
「型リファレンス」セクションAcquireTokenOptions
「AcquireTokenOptions」セクション対話的なトークン取得のオプションです。
export interface AcquireTokenOptions { /** * Scopes to request, for example `https://graph.microsoft.com/.default`. */ scopes: string[];
/** * When true, always show the Microsoft account picker or sign-in UI. * * @default false */ forcePrompt?: boolean;
/** * Optional login hint for the interactive sign-in flow. */ loginHint?: string;}IntuneMAMAcquireToken
「IntuneMAMAcquireToken」セクションexport interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}AcquireTokenSilentOptions
「AcquireTokenSilentOptions」セクションサイレントでのトークン取得オプションです。
export interface AcquireTokenSilentOptions { /** * Scopes to request, for example `https://graph.microsoft.com/.default`. */ scopes: string[];
/** * Microsoft Entra object ID returned by `acquireToken` or `enrolledAccount`. */ accountId: string;
/** * When true, bypass the cached access token and request a fresh one. * * @default false */ forceRefresh?: boolean;}RegisterAndEnrollAccountOptions
「RegisterAndEnrollAccountOptions」セクションexport interface RegisterAndEnrollAccountOptions { /** * Microsoft Entra object ID returned by `acquireToken`. */ accountId: string;}IntuneMAMUser
「IntuneMAMUser」セクションexport interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
「IntuneMAMAppConfig」セクションexport interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
「IntuneMAMPolicy」セクションexport interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
「IntuneMAMGroupName」セクションexport interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
「IntuneMAMVersionInfo」セクションexport interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
「IntuneMAMChangeEvent」セクションexport interface IntuneMAMChangeEvent { accountId?: string;}Source of Truth
「Source Of Truth」セクションこのページはプラグインの src/definitions.tsから生成されています。upstream で公開 API が変更されたら、再度 sync を実行してください。
Getting Startedの続きを進める
「Getting Started からの続き」セクション使用している場合 スタートガイド ダッシュボードと API の運用を計画するには、これを次と連携させます @capgo/capacitor-intuneの使用方法 @capgo/capacitor-intune の使用におけるネイティブ機能について、 API の概要 「API の概要」の実装の詳細については、 はじめに 「はじめに」における実装の詳細については、 API キー および「API Keys」の実装の詳細については、 デバイス 実装の詳細については Devices を参照してください。