Erste Schritte
Kopiere einen Setup-Prompt mit den Installationsschritten und dem vollständigen Markdown-Guide für dieses 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.
Installieren
Abschnitt „Installation“Du kannst unser KI-gestütztes Setup nutzen, um das Plugin zu installieren. Füge die Capgo Skills mit dem folgenden Befehl deinem KI-Tool hinzu:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsNutze dann diesen Prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intune` plugin in my project.Wenn du ein manuelles Setup bevorzugst, installiere das Plugin mit den folgenden Befehlen und befolge die plattformspezifischen Anweisungen unten:
bun add @capgo/capacitor-intunebunx cap syncImportieren
Abschnitt mit dem Titel „Import“import { IntuneMAM } from '@capgo/capacitor-intune';Quickstart
Abschnitt „Quick start“import { Persona } from '@capgo/capacitor-persona';
await Persona.startInquiry({});Häufige Stolperfallen
Abschnitt „Häufige Fallstricke“- Listener: Handles beim Unmounten von Screens entfernen.
- Nativer Sync: ausführen
bunx cap syncnach Plugin-Upgrades. - Single Source of Truth: Vertrauen
src/definitions.tsim GitHub Repo.
API Übersicht
Abschnitt „API Übersicht“acquireToken
Abschnitt mit dem Titel “acquireToken”Startet den Microsoft Sign-in-Flow und gibt ein Access Token sowie die Account-Metadaten zurück.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });// The result holds sensitive values: use it without logging it.acquireTokenSilent
Abschnitt mit dem Titel “acquireTokenSilent”Ruft ein Token aus dem MSAL-Cache für einen bereits angemeldeten User ab.
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
Abschnitt mit dem Titel “registerAndEnrollAccount”Registriert ein zuvor authentifiziertes Konto bei Intune und startet das Enrollment.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });loginAndEnrollAccount
Abschnitt mit dem Titel „loginAndEnrollAccount“Fordert Intune auf, einen User zu authentifizieren und zu enrollen, ohne vorher ein App-Token anzufordern.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
Abschnitt mit dem Titel “enrolledAccount”Gibt das aktuell enrollte Intune-Konto zurück, sofern eines verfügbar ist.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();console.log(result);deRegisterAndUnenrollAccount
Abschnitt mit dem Titel “deRegisterAndUnenrollAccount”Das Konto bei Intune abmelden und bei Bedarf einen selektiven Wipe auslösen.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });logoutOfAccount
Abschnitt mit dem Titel “logoutOfAccount”Melde den Benutzer bei MSAL ab, ohne die Registrierung des Intune-Kontos aufzuheben.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });appConfig
Abschnitt mit dem Titel “appConfig”Ruft die Remote-Intune-Appkonfiguration für ein verwaltetes Konto ab.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });console.log(result);getPolicy
Abschnitt mit dem Titel „getPolicy“Ruft die aktuell gültige Intune App Protection Policy für ein verwaltetes Konto ab.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });console.log(result);groupName
Abschnitt mit dem Titel „groupName“Praktischer Helper, der den GroupName App-Konfigurationswert auflöst, falls vorhanden.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });console.log(result);sdkVersion
Abschnitt mit dem Titel „sdkVersion“Gibt die nativen Intune- und MSAL SDK Versionen zurück, die in diesem Plugin enthalten sind.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();console.log(result);displayDiagnosticConsole
Abschnitt mit dem Titel “displayDiagnosticConsole”Zeigt die native Intune-Diagnose-UI an.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();Typreferenz
Abschnitt mit dem Titel „Typreferenz“AcquireTokenOptions
Abschnitt mit dem Titel “AcquireTokenOptions”Interaktive Token-Abrufoptionen.
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
Abschnitt mit dem Titel “IntuneMAMAcquireToken”export interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}AcquireTokenSilentOptions
Abschnitt mit dem Titel “AcquireTokenSilentOptions”Optionen für die stille Token-Akquise.
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
Abschnitt mit dem Titel “RegisterAndEnrollAccountOptions”export interface RegisterAndEnrollAccountOptions { /** * Microsoft Entra object ID returned by `acquireToken`. */ accountId: string;}IntuneMAMUser
Abschnitt mit dem Titel “IntuneMAMUser”export interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
Abschnitt mit dem Titel “IntuneMAMAppConfig”export interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
Abschnitt mit dem Titel “IntuneMAMPolicy”export interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
Abschnitt mit dem Titel “IntuneMAMGroupName”export interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
Abschnitt mit dem Titel “IntuneMAMVersionInfo”export interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
Abschnitt mit dem Titel „IntuneMAMChangeEvent“export interface IntuneMAMChangeEvent { accountId?: string;}Source of Truth
Abschnitt mit dem Titel „Source of Truth“Diese Seite wird aus dem Plugin generiert src/definitions.ts. Führe den Sync erneut aus, wenn sich das öffentliche API upstream ändert.
Weiter geht's nach Getting Started
Abschnitt: „Weiter geht’s mit Getting Started“Wenn du es nutzt Erste Schritte um Dashboard- und API-Operationen zu planen, verbinde es mit Verwendung von @capgo/capacitor-intune für die native Funktion bei der Verwendung von @capgo/capacitor-intune, API Übersicht für Details zur Implementierung im API Overview, Einführung für die Implementierungsdetails in der Einleitung, API Schlüssel für das Implementierungsdetail in API Keys und Geräte für das Implementierungsdetail in Devices.