Saltar al contenido

Getting Started

GitHub

Puede utilizar nuestra configuración asistida por IA para instalar el complemento. Agregue las Capgo habilidades a su herramienta de IA utilizando el siguiente comando:

Ventana de terminal
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Luego utilice la siguiente solicitud:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intune` plugin in my project.

Si prefiere la configuración manual, instale el complemento ejecutando los siguientes comandos y siguiendo las instrucciones específicas de la plataforma a continuación:

Ventana de terminal
bun add @capgo/capacitor-intune
bunx cap sync
import { IntuneMAM } from '@capgo/capacitor-intune';

Presenta el flujo de inicio de sesión de Microsoft y devuelve un token de acceso junto con los metadatos de la cuenta.

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

Obtener un token desde la caché de MSAL para un usuario previamente registrado.

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.

Registre una cuenta previamente autenticada con Intune y comience el proceso de inscripción.

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

Pida a Intune que autentique y enrole a un usuario sin solicitar primero un token de aplicación.

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

Devuelve la cuenta de Intune en curso, si está disponible.

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

Deseche la cuenta de Intune y active el borrado selectivo cuando sea aplicable.

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

Cerrar al usuario de MSAL sin desinscribir la cuenta de Intune.

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

Obtener la configuración de la aplicación remota de Intune para una cuenta administrada.

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

Obtener la política de protección de aplicaciones de Intune vigente para una cuenta administrada.

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

Ayuda de conveniencia que resuelve el GroupName app configuration value when present.

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

Devuelve las versiones nativas de Intune y MSAL SDK empaquetadas por este plugin.

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

Show the native Intune diagnostics UI.

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

Opciones de adquisición de token interactivas.

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;
}
export interface IntuneMAMAcquireToken {
accountId: string;
accessToken: string;
accountIdentifier: string;
idToken?: string;
username?: string;
tenantId?: string;
authority?: string;
}

Opciones de obtención de token silencioso.

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

OpciónDeRegistroYInscripciónDeCuenta
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;
}
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;
}
export interface IntuneMAMGroupName {
accountId: string;
groupName?: string;
}
export interface IntuneMAMVersionInfo {
platform: 'ios' | 'android';
intuneSdkVersion: string;
msalVersion?: string;
}
export interface IntuneMAMChangeEvent {
accountId?: string;
}

Esta página se genera a partir del plugin’s src/definitions.tsRe-ejecutar la sincronización cuando el público API cambie en la fuente.

Si estás utilizando Getting Started para planificar la consola y las operaciones de API, conecta con Usando @capgo/capacitor-intune para la capacidad nativa en Usando @capgo/capacitor-intune, API Resumen para el detalle de implementación en API Resumen, Introducción para el detalle de implementación en Introducción, API Claves para los detalles de implementación en API Claves, y Dispositivos para los detalles de implementación en Dispositivos.