跳过内容

开始使用

GitHub

安装

安装

您可以使用我们的 AI 助手设置来安装插件。将 Capgo 技能添加到您的 AI 工具中,使用以下命令:

终端窗口
bunx 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';

快速入门

快速入门
import { Persona } from '@capgo/capacitor-persona';
await Persona.startInquiry({});

常见问题

常见问题
  • 监听器: 移除屏幕卸载时的句柄。
  • 原生同步: 运行 bunx cap sync 升级插件后
  • 真实来源: 信任 src/definitions.ts 在 GitHub 仓库中

呈现 Microsoft 登录流程并返回访问令牌及帐户元数据

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });
// The result holds sensitive values: use it without logging it.

从 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

注册并开始注册

登录并开始注册

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });

已注册帐户

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

注销并取消注册

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();
console.log(result);

deRegisterAndUnenrollAccount

__CAPGO_KEEP_0__

Deregister Intune账户并在适用情况下触发选择性清除。

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });

logoutOfAccount

登出账户

注销用户MSAL账户而不解除Intune账户注册

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });

appConfig

应用配置

获取远程Intune应用配置

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });
console.log(result);

获取Intune应用保护策略

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });
console.log(result);

groupName

组名称

便捷工具,用于解析 GroupName 当存在时,应用配置值

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });
console.log(result);

返回本地 Intune 和 MSAL SDK 版本,通过此插件打包。

import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();
console.log(result);

标题为“displayDiagnosticConsole”

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

显示原生Intune诊断UI。

类型参考

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

Intune MAM 用户
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

复制到剪贴板
export interface IntuneMAMAppConfig {
accountId: string;
fullData: Record<string, string>[];
values: Record<string, string>;
conflicts: string[];
}

IntuneMAMPolicy

Intune MAM 政策
export interface IntuneMAMPolicy {
accountId: string;
isPinRequired?: boolean;
isManagedBrowserRequired?: boolean;
isScreenCaptureAllowed?: boolean;
isContactSyncAllowed?: boolean;
isAppSharingAllowed?: boolean;
isFileEncryptionRequired?: boolean;
notificationPolicy?: string;
}

IntuneMAMGroupName

Intune MAM 组名
export interface IntuneMAMGroupName {
accountId: string;
groupName?: string;
}

IntuneMAMVersionInfo

Intune MAM 版本信息
export interface IntuneMAMVersionInfo {
platform: 'ios' | 'android';
intuneSdkVersion: string;
msalVersion?: string;
}

IntuneMAMChangeEvent

Intune MAM 变更事件
export interface IntuneMAMChangeEvent {
accountId?: string;
}

真实来源

真实来源

本页面是根据插件生成的 src/definitions.ts重新同步时,公共API发生变化时,请重新运行。

如果您正在使用 开始 用于规划仪表板和API操作的 使用@capgo/capacitor-intune 使用@capgo/capacitor-intune 使用@API/__CAPGO_KEEP_1__-intune API概述 __CAPGO_KEEP_0__概述 介绍 API 键 为 API 键的实现细节 设备 为设备的实现细节