Zum Inhalt springen

Einstieg

  1. Installieren Sie das Paket

    Terminal-Fenster
    bun add @capgo/capacitor-intune
  2. Synchronisieren Sie native Projekte

    Terminal-Fenster
    bunx cap sync
  3. Vollständige native Intune-Einrichtung Folgen Sie der speziellen iOS-Einrichtung und Android-Einrichtung pages. Intune erfordert weiterhin eine native App-Konfiguration für den Broker-Authentifizierungsprozess, Redirect-URIs, Manifeste, Berechtigungen und die MSAL-Konfiguration.

  • Capacitor 8+
  • Android mit Intune Android SDK 12.0.3
  • iOS mit Intune iOS SDK 21.5.1
  • Zielplattform für iOS-Implementierung 17.0+

Die aktuellen Ionic-Intune-Dokumente weisen derzeit einen Stichtag vom 19. Januar 2026 für Apps aus, die mit Xcode 26 erstellt wurden, und erfordern Intune iOS SDK 21.1.0+. Dieser Plugin verwendet bereits 21.5.1.

import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.addListener('appConfigChange', (result) => {
console.log('App config changed', result.accountId);
});
await IntuneMAM.addListener('policyChange', (result) => {
console.log('Policy changed', result.accountId);
});
const auth = await IntuneMAM.acquireToken({
scopes: ['https://graph.microsoft.com/.default'],
loginHint: 'alex@example.com',
});
await IntuneMAM.registerAndEnrollAccount({
accountId: auth.accountId,
});
const appConfig = await IntuneMAM.appConfig({
accountId: auth.accountId,
});
const policy = await IntuneMAM.getPolicy({
accountId: auth.accountId,
});
console.log({ auth, appConfig, policy });
const auth = await IntuneMAM.acquireToken({
scopes: ['https://graph.microsoft.com/.default'],
});
await IntuneMAM.registerAndEnrollAccount({
accountId: auth.accountId,
});
const token = await IntuneMAM.acquireTokenSilent({
accountId: 'AAD_OBJECT_ID',
scopes: ['https://graph.microsoft.com/.default'],
forceRefresh: true,
});
const user = await IntuneMAM.enrolledAccount();
await IntuneMAM.logoutOfAccount({ accountId: 'AAD_OBJECT_ID' });
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'AAD_OBJECT_ID' });
  • acquireToken(options): Starte die Microsoft-Anmeldung und gib Token und Account-Metadaten zurück.
  • acquireTokenSilent(options): Lies ein abgespeichertes Token für ein bestehendes Konto.
  • registerAndEnrollAccount(options): Registriere das MSAL-Konto mit Intune und löse die Registrierung aus.
  • loginAndEnrollAccount(): Lasse Intune den Anmelde- und Registrierungsprozess steuern.
  • appConfig(user): Lies die Intune-App-Konfigurationswerte für das Konto.
  • getPolicy(user): Lies die aktuelle Intune-App-Schutzrichtlinie für das Konto.
  • groupName(user): Lies den gemeinsamen GroupName Konfig-Hilfswert, wenn vorhanden.
  • sdkVersion(): Inspecte die integrierten Intune- und MSAL-Versionen.
  • Web wird nicht unterstützt.
  • iOS und Android erfordern beide eine native Projekt-Konfiguration über cap sync.
  • Ihre Azure-Registrierung, Intune-Policy-Zuweisung, Redirect-URIs und Berechtigungen bleiben app-spezifisch.