Panduan Memulai
Salin prompt setup yang berisi langkah install dan panduan markdown lengkap untuk plugin ini.
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.
Anda bisa menggunakan AI-Assisted Setup kami untuk menginstal plugin ini. Tambahkan skill Capgo ke tool AI Anda dengan command berikut:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsLalu gunakan prompt berikut:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intune` plugin in my project.Jika Anda lebih memilih Manual Setup, instal plugin dengan menjalankan perintah berikut dan ikuti petunjuk khusus platform di bawah ini:
bun add @capgo/capacitor-intunebunx cap syncimport { IntuneMAM } from '@capgo/capacitor-intune';Mulai cepat
Bagian berjudul “Mulai cepat”import { Persona } from '@capgo/capacitor-persona';
await Persona.startInquiry({});Kesalahan umum
Bagian berjudul “Kesalahan umum”- Listener: hapus handle saat screen unmount.
- Sinkronisasi Native: jalankan
bunx cap syncsetelah upgrade plugin. - Sumber kebenaran tunggal: percayai
src/definitions.tsdi repo GitHub.
Ringkasan API
Bagian berjudul “Ikhtisar API”acquireToken
Bagian berjudul “acquireToken”Tampilkan alur sign-in Microsoft dan kembalikan access token beserta metadata akun.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.acquireToken({ scopes: ['openid'] });// The result holds sensitive values: use it without logging it.acquireTokenSilent
Bagian berjudul “acquireTokenSilent”Ambil token dari cache MSAL untuk user yang sebelumnya sudah sign-in.
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
Bagian berjudul “registerAndEnrollAccount”Daftarkan akun yang sudah diautentikasi sebelumnya ke Intune dan mulai enrollment.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.registerAndEnrollAccount({ accountId: 'account-id-123' });loginAndEnrollAccount
Bagian berjudul “loginAndEnrollAccount”Minta Intune mengautentikasi dan mendaftarkan user tanpa meminta app token terlebih dahulu.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.loginAndEnrollAccount();enrolledAccount
Bagian berjudul “enrolledAccount”Kembalikan akun Intune yang saat ini terdaftar, jika ada.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.enrolledAccount();console.log(result);deRegisterAndUnenrollAccount
Bagian berjudul “deRegisterAndUnenrollAccount”Hapus pendaftaran akun dari Intune dan picu selective wipe jika berlaku.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.deRegisterAndUnenrollAccount({ accountId: 'account-id-123' });logoutOfAccount
Bagian berjudul “logoutOfAccount”Keluarkan user dari MSAL tanpa membatalkan enrollment akun Intune.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.logoutOfAccount({ accountId: 'account-id-123' });appConfig
Bagian berjudul “appConfig”Ambil konfigurasi aplikasi Intune jarak jauh untuk akun yang dikelola.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.appConfig({ accountId: 'account-id-123' });console.log(result);getPolicy
Bagian berjudul “getPolicy”Ambil kebijakan perlindungan aplikasi Intune yang berlaku saat ini untuk akun terkelola.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.getPolicy({ accountId: 'account-id-123' });console.log(result);groupName
Bagian berjudul “groupName”Helper praktis yang mengambil GroupName nilai konfigurasi aplikasi jika tersedia.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.groupName({ accountId: 'account-id-123' });console.log(result);sdkVersion
Bagian berjudul “sdkVersion”Mengembalikan versi native Intune dan MSAL SDK yang disertakan dalam plugin ini.
import { IntuneMAM } from '@capgo/capacitor-intune';
const result = await IntuneMAM.sdkVersion();console.log(result);displayDiagnosticConsole
Bagian berjudul “displayDiagnosticConsole”Tampilkan UI diagnostik native Intune.
import { IntuneMAM } from '@capgo/capacitor-intune';
await IntuneMAM.displayDiagnosticConsole();Referensi Tipe
Bagian berjudul “Referensi Tipe”AcquireTokenOptions
Bagian berjudul “AcquireTokenOptions”Opsi akuisisi token interaktif.
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
Bagian berjudul “IntuneMAMAcquireToken”export interface IntuneMAMAcquireToken { accountId: string; accessToken: string; accountIdentifier: string; idToken?: string; username?: string; tenantId?: string; authority?: string;}AcquireTokenSilentOptions
Bagian berjudul “AcquireTokenSilentOptions”Opsi akuisisi token senyap.
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
Bagian berjudul “RegisterAndEnrollAccountOptions”export interface RegisterAndEnrollAccountOptions { /** * Microsoft Entra object ID returned by `acquireToken`. */ accountId: string;}IntuneMAMUser
Bagian berjudul “IntuneMAMUser”export interface IntuneMAMUser { accountId: string; accountIdentifier?: string; username?: string; tenantId?: string; authority?: string;}IntuneMAMAppConfig
Bagian berjudul “IntuneMAMAppConfig”export interface IntuneMAMAppConfig { accountId: string; fullData: Record<string, string>[]; values: Record<string, string>; conflicts: string[];}IntuneMAMPolicy
Bagian berjudul “IntuneMAMPolicy”export interface IntuneMAMPolicy { accountId: string; isPinRequired?: boolean; isManagedBrowserRequired?: boolean; isScreenCaptureAllowed?: boolean; isContactSyncAllowed?: boolean; isAppSharingAllowed?: boolean; isFileEncryptionRequired?: boolean; notificationPolicy?: string;}IntuneMAMGroupName
Bagian berjudul “IntuneMAMGroupName”export interface IntuneMAMGroupName { accountId: string; groupName?: string;}IntuneMAMVersionInfo
Bagian berjudul “IntuneMAMVersionInfo”export interface IntuneMAMVersionInfo { platform: 'ios' | 'android'; intuneSdkVersion: string; msalVersion?: string;}IntuneMAMChangeEvent
Bagian berjudul “IntuneMAMChangeEvent”export interface IntuneMAMChangeEvent { accountId?: string;}Sumber Kebenaran
Bagian berjudul “Sumber Kebenaran”Halaman ini dibuat dari plugin src/definitions.ts. Jalankan ulang sync saat API publik berubah di upstream.
Lanjutkan dari Getting Started
Bagian berjudul “Lanjutkan dari Getting Started”Jika Anda menggunakan Panduan Memulai untuk merencanakan operasi dashboard dan API, hubungkan dengan Menggunakan @capgo/capacitor-intune untuk kapabilitas native saat menggunakan @capgo/capacitor-intune, Ringkasan API untuk detail implementasi di API Overview, Pendahuluan untuk detail implementasi di Introduction, Kunci API untuk detail implementasi di API Keys, dan Perangkat untuk detail implementasi di Devices.