跳过主要内容
返回插件
@capgo/capacitor-intune
教程
@capgo/capacitor-intune

Intune

Microsoft Intune MAM, app protection policy, app config, and MSAL authentication for Capacitor

指南

Intune教程

使用@capgo/capacitor-intune

Capacitor插件支持Microsoft Intune MAM注册、应用保护策略、应用配置和MSAL身份验证。

安装

bun add @capgo/capacitor-intune
bunx cap sync

此插件暴露的内容

  • acquireToken - 展示Microsoft登录流程并返回访问令牌及帐户元数据
  • acquireTokenSilent - 从MSAL缓存中获取之前登录用户的令牌
  • registerAndEnrollAccount - 将之前验证的帐户注册到Intune并开始注册
  • loginAndEnrollAccount - 请要求 Intune 验证并为用户注册,而不先要求应用令牌。

示例用途

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

全局参考

继续使用 @capgo/capacitor-intune

如果您正在使用 使用@capgo/capacitor-intune 规划认证和帐户流程,连接它与 使用@capgo/capacitor-intune 在@capgo/capacitor-intune中查看实现细节 开始 在开始中查看实现细节 使用@capgo/capacitor-social-login 在@capgo/capacitor-social-login中查看实现细节 使用@capgo/capacitor-passkey 在@capgo/capacitor-passkey中查看实现细节 使用@capgo/capacitor-native-biometric 在@capgo/capacitor-native-biometric中查看实现细节