跳过内容

Getting Started

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

API Overview

API概述

显示 Microsoft 登录流程并返回访问令牌及帐户元数据。

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

从 MSAL 缓存中获取之前登录的用户的令牌。

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

将之前已验证的帐户注册到 Intune 并开始注册。

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

要求 Intune 对用户进行身份验证并注册,而无需先请求应用程序令牌。

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

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

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

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

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

在不解除 Intune 帐户的情况下,使用 MSAL 登出用户。

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 复制到剪贴板

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。

复制到剪贴板

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

标题:IntuneMAMAppConfig
export interface IntuneMAMAppConfig {
accountId: string;
fullData: Record<string, string>[];
values: Record<string, string>;
conflicts: string[];
}
export interface IntuneMAMPolicy {
accountId: string;
isPinRequired?: boolean;
isManagedBrowserRequired?: boolean;
isScreenCaptureAllowed?: boolean;
isContactSyncAllowed?: boolean;
isAppSharingAllowed?: boolean;
isFileEncryptionRequired?: boolean;
notificationPolicy?: string;
}

IntuneMAMGroupName

标题:IntuneMAMGroupName
export interface IntuneMAMGroupName {
accountId: string;
groupName?: string;
}

IntuneMAMVersionInfo

标题:IntuneMAMVersionInfo
export interface IntuneMAMVersionInfo {
platform: 'ios' | 'android';
intuneSdkVersion: string;
msalVersion?: string;
}

IntuneMAMChangeEvent

标题:IntuneMAMChangeEvent
export interface IntuneMAMChangeEvent {
accountId?: string;
}

真实数据来源

标题:真实数据来源

本页面是从插件的 src/definitions.ts重新同步公共API时,API发生了变化。

如果您正在使用 开始 来规划仪表板和API操作,连接它到 使用@capgo/capacitor-intune 用于在使用@capgo/capacitor-intune中native能力 API 简介 为 API 简介 的实现细节 介绍 为介绍 的实现细节 API 密钥 为 API 密钥 的实现细节, 和 设备 为设备 的实现细节。