Prise en main
Copiez le prompt de configuration avec les étapes d'installation et la guide Markdown complet pour ce plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intune`, `@capgo/capacitor-persona`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/persona/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installation
Section intitulée « Installation »Vous pouvez utiliser notre configuration assistée par l'IA pour installer le plugin. Ajoutez les Capgo compétences à votre outil d'IA en utilisant la commande suivante :
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsEnsuite, utilisez la prompt suivante :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intune` plugin in my project.Si vous préférez la configuration manuelle, installez le plugin en exécutant les commandes suivantes et suivez les instructions spécifiques au plateforme ci-dessous :
bun add @capgo/capacitor-intunebunx cap syncImportation
Section intitulée « Importation »import { IntuneMAM } from '@capgo/capacitor-intune';Début rapide
Section intitulée « Début rapide »import { Persona } from '@capgo/capacitor-persona';
await Persona.startInquiry({});Problèmes courants
Section intitulée « Problèmes courants »- Écouteurs: supprimez les handles lorsqu'un écran est démonté.
- Sync natif: exécutez
bunx cap syncaprès mises à jour du plugin. - Source de vérité: confiez
src/definitions.tsdans le dépôt GitHub.
API : Présentation
Titre de la section « API : Présentation »acquireToken
Titre de la section « acquireToken »Présentez le flux de connexion Microsoft et renvoyez un jeton d'accès ainsi que les métadonnées du compte.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });// The result holds sensitive values: use it without logging it.acquireTokenSilent
Acquérir un jeton silencieuxObtenez un jeton à partir de la cache MSAL pour un utilisateur connecté précédemment.
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
Section intitulée « enregistrerEtInscrireCompte »Enregistrez un compte authentifié précédemment avec Intune et commencez l'inscription.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });loginAndEnrollAccount
Section intitulée « seConnecterEtInscrireCompte »Demandez à Intune de s'authentifier et d'inscrire un utilisateur sans demander d'abord un jeton d'application.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
Section intitulée « compteInscrit »Retournez le compte Intune actuellement inscrit, si l'un est disponible.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();console.log(result);deRegisterAndUnenrollAccount
Section intitulée « désinscrireEtDéinscrireCompte »Désinscrire le compte de Intune et déclencher un effacement sélectif lorsqu'il est applicable.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });logoutOfAccount
Section titled “logoutOfAccount”Déconnecter l'utilisateur de MSAL sans déenregistrer le compte Intune.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });appConfig
Configuration de l'applicationRécupérer la configuration d'application Intune à distance pour un compte géré.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });console.log(result);getPolicy
Politique d'applicationRécupérer la politique d'application de protection Intune actuellement effective pour un compte géré.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });console.log(result);groupName
Section intitulée “groupName”Aide de confort qui résout le GroupName app configuration value when present.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });console.log(result);Renvoie les versions natives d'Intune et de MSAL SDK bundlées par ce plugin.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();console.log(result);displayDiagnosticConsole
Afficher le console de diagnosticAffiche la console de diagnostic native d'Intune.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();Référence de type
Sous-section intitulée « Référence de type »AcquireTokenOptions
Option d'acquisition de jetonOptions d'acquisition de jetons interactifs.
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
Section titled “IntuneMAMAcquireToken”export interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}AcquireTokenSilentOptions
Section intitulée « IntuneMAMAcquireToken »Section intitulée « 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
Options d'acquisition de jetons silencieuses.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
Section intitulée « IntuneMAMUser »export interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
Section intitulée « IntuneMAMPolicy »export interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
Section intitulée « IntuneMAMGroupName »export interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
Section intitulée « IntuneMAMVersionInfo »export interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
Section intitulée « IntuneMAMChangeEvent »export interface IntuneMAMChangeEvent { accountId?: string;}Source de Vérité
Section intitulée « Source de Vérité »Cette page est générée à partir du plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.
Continuez de Getting Started
Section intitulée “Continuez de Getting Started”Si vous utilisez Getting Started pour planifier le tableau de bord et les opérations API, connectez-l’avec Utilisation de @capgo/capacitor-intune pour la capacité native dans Utilisation de @capgo/capacitor-intune, API Overview pour le détail d'implémentation dans API Overview, Introduction pour le détail d'implémentation dans Introduction, API Clés pour le détail d'implémentation dans API Clés, et Appareils pour les détails d'implémentation sur les appareils.