开始
复制一个包含安装步骤和本插件的全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-Assisted Setup来安装插件。使用以下命令将Capgo技能添加到您的AI工具中:
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.如果您更喜欢手动设置,请按照以下命令安装插件,并遵循以下平台特定的说明:
bun add @capgo/capacitor-intunebunx cap sync导入
导入import { IntuneMAM } from '@capgo/capacitor-intune';API概述
API概述acquireToken
Section titled “acquireToken”展现 Microsoft 登录流程并返回访问令牌及帐户元数据。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.acquireToken({} as AcquireTokenOptions);acquireTokenSilent
Section titled “acquireTokenSilent”从 MSAL 缓存中获取之前登录的用户的令牌。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.acquireTokenSilent({} as AcquireTokenSilentOptions);registerAndEnrollAccount
Section titled “registerAndEnrollAccount”将之前已验证的帐户注册到 Intune 并开始注册。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({} as RegisterAndEnrollAccountOptions);loginAndEnrollAccount
Section titled “loginAndEnrollAccount”要求 Intune 验证并注册用户,而无需先请求应用令牌。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
Section titled “已注册帐户”返回当前已注册的 Intune 帐户,如果有的话。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.enrolledAccount();deRegisterAndUnenrollAccount
Section titled “注销和注销帐户”注销帐户从 Intune 并触发选择性擦除时适用。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({} as IntuneMAMUser);logoutOfAccount
Section titled “注销帐户”用户注销 MSAL 而不注销 Intune 帐户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({} as IntuneMAMUser);appConfig
Section titled “应用配置”获取远程 Intune 应用配置的管理帐户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.appConfig({} as IntuneMAMUser);getPolicy
Section titled “getPolicy”获取当前有效的 Intune 应用保护策略。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.getPolicy({} as IntuneMAMUser);groupName
Section titled “groupName”一个便捷的帮助函数,解析 app 配置值。 GroupName 复制到剪贴板
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.groupName({} as IntuneMAMUser);Return the native Intune and MSAL SDK versions bundled by this plugin.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.sdkVersion();displayDiagnosticConsole
显示 native Intune 诊断 UI。Fetch the currently effective Intune app protection policy for a managed account.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();类型参考
类型参考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
复制到剪贴板export interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}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
复制到剪贴板export interface RegisterAndEnrollAccountOptions { /** * Microsoft Entra object ID returned by `acquireToken`. */ accountId: string;}IntuneMAMUser
标题:IntuneMAMUserexport interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
标题:IntuneMAMAppConfigexport interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
标题:IntuneMAMPolicyexport interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
标题:IntuneMAMGroupNameexport interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
标题:IntuneMAMVersionInfoexport interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
标题:IntuneMAMChangeEventexport interface IntuneMAMChangeEvent { accountId?: string;}真实数据来源
真实数据来源本页面由插件生成 src/definitions.ts当公共API在上游发生变化时,请重新运行同步
继续从开始
如果您正在使用开始 规划仪表板和__CAPGO_KEEP_0__操作 to plan dashboard and API operations, connect it with 使用@capgo/capacitor-intune 使用@capgo/capacitor-intune API 简介 为 API 简介 的实现细节 介绍 为介绍 的实现细节 API 密钥 为 API 密钥 的实现细节, 和 设备 为设备 的实现细节。