はじめましょう
このプラグインのインストール手順とマークダウンガイドを含むセットアップのコピー用
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スキルを追加するには、以下のコマンドを実行してください。
npx 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.Manual Setupを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の手順に従ってください。
bun add @capgo/capacitor-intunebunx cap syncインポート
「インポート」のセクションimport { IntuneMAM } from '@capgo/capacitor-intune';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」現在のインチューンアカウントを取得します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();console.log(result);deRegisterAndUnenrollAccount
「アカウントの登録解除とアンインストール」セクションアカウントをインチューンから登録解除し、適用可能な場合に選択的な削除をトリガーします。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });logoutOfAccount
「アカウントのログアウト」セクションMSALからユーザーをサインアウトし、インチューンアカウントをアンインストールしないようにします。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });appConfig
「アプリの設定」セクション管理されたアカウントのためのリモートインチューンアプリの構成を取得します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });console.log(result);getPolicy
「ポリシーを取得」セクション現在の有効な Intune アプリ保護ポリシーを取得します。
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });console.log(result);groupName
「groupName」タイトルのセクションアプリの設定値が存在する場合に解決する便利なヘルパー GroupName 「sdkVersion」タイトルのセクション
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });console.log(result);Return the native Intune and MSAL SDK versions bundled by this plugin.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();console.log(result);displayDiagnosticConsole
ネイティブ Intune の診断 UI を表示します。診断 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;}真実の源
「真実の源」このページはプラグインの src/definitions.tsパブリック API がアップストリームで変更された場合に再度 Sync を実行してください。
Getting Started から続けてください。
「Getting Started から続けてください」あなたが使用している場合 Getting Started ダッシュボードと API の計画と実行を支援するため、 @capgo/capacitor-intune Using @capgo/capacitor-intune のネイティブ機能 API の概要 Capgoの実装詳細についてはAPIの概要を参照してください。 概要 Capgoの実装詳細については概要を参照してください。 APIのキー Capgoの実装詳細についてはAPIのキー、 デバイス Capgoの実装詳細についてはデバイスを参照してください。