跳过内容

开始使用

终端窗口
bun add @capgo/capacitor-intune
bunx cap sync

导入

导入
import { IntuneMAM } from '@capgo/capacitor-intune';

API概述

API概述

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

返回可用的 Intune 已注册账户,如果有的话。

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

deRegisterAndUnenrollAccount

标题:注销并注销账户

从 Intune 注销账户并在适用时触发选择性擦除。

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

logoutOfAccount

登出账户

在未注销 Intune 账户的情况下,使用 MSAL 登出用户。

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 当存在时的应用配置值。

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

此插件通过此插件捆绑的原生Intune和MSAL SDK 版本。

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

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;
}
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

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上游更改时,请重新同步。