开始使用
复制一个带有安装步骤和完整 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 助手设置来安装插件。将 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 syncimport { IntuneMAM } from '@capgo/capacitor-intune';API概述
名为“API概述”的部分acquireToken
名为“acquireToken”的部分呈现 Microsoft 登录流程并返回访问令牌及帐户元数据。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.acquireToken({} as AcquireTokenOptions);acquireTokenSilent
标题:获取静默令牌获取 MSAL 缓存中的一次性登录用户的令牌。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.acquireTokenSilent({} as AcquireTokenSilentOptions);registerAndEnrollAccount
标题:注册并注册帐户注册 Intune 中的已验证帐户并开始注册。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({} as RegisterAndEnrollAccountOptions);loginAndEnrollAccount
标题:登录并注册帐户向 Intune 请求用户身份验证并注册帐户(无需先请求应用令牌)。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
标题:已注册帐户返回当前已注册的 Intune 帐户,如果有的话。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.enrolledAccount();deRegisterAndUnenrollAccount
标题:“注销并解除注册帐户”注销帐户从 Intune 并触发适用的选择性擦除。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({} as IntuneMAMUser);logoutOfAccount
标题:“注销帐户”注销用户从 MSAL 而不解除注册 Intune 帐户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({} as IntuneMAMUser);appConfig
标题:“应用配置”获取远程 Intune 应用配置的管理帐户。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.appConfig({} as IntuneMAMUser);getPolicy
标题:“获取策略”获取当前有效的 Intune 应用保护策略。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.getPolicy({} as IntuneMAMUser);groupName
标题:"groupName"一个便捷工具,用于解析 app 配置值。 GroupName 标题:"sdkVersion"
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.groupName({} as IntuneMAMUser);返回本地 Intune 和 MSAL SDK 版本,通过此插件打包。
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.sdkVersion();displayDiagnosticConsole
显示 native Intune 诊断 UI。标题:"groupName"
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
Intune MAM 获取令牌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
IntuneMAM用户配置export interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
IntuneMAM应用配置export interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
IntuneMAM策略export interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
IntuneMAM组名称export interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
IntuneMAM版本信息export interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
IntuneMAM事件变化export interface IntuneMAMChangeEvent { accountId?: string;}真实数据来源
标题:真实数据来源本页面由插件的 src/definitions.ts重新同步时,公共API发生更改时,请重新运行上游。
继续从 Getting Started
标题:继续从 Getting Started如果您正在使用 开始使用 来规划仪表板和API操作,请将其连接到 使用@capgo/capacitor-intune 使用@capgo/capacitor-intune API概述 为 API 概述的实现细节 简介 为简介的实现细节 API 密钥 为 API 密钥的实现细节,并且 设备 为设备的实现细节。