跳过内容

开始使用

GitHub

您可以使用我们的 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-intune
bunx cap sync
import { IntuneMAM } from '@capgo/capacitor-intune';

呈现 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();

返回当前已注册的 Intune 帐户,如果有的话。

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.enrolledAccount();

deRegisterAndUnenrollAccount

标题:“注销并解除注册帐户”

注销帐户从 Intune 并触发适用的选择性擦除。

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({} as IntuneMAMUser);

注销用户从 MSAL 而不解除注册 Intune 帐户。

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({} as IntuneMAMUser);

获取远程 Intune 应用配置的管理帐户。

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.appConfig({} as IntuneMAMUser);

获取当前有效的 Intune 应用保护策略。

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.getPolicy({} as IntuneMAMUser);

一个便捷工具,用于解析 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;
}
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 密钥的实现细节,并且 设备 为设备的实现细节。