본문 바로가기

시작하기

GitHub

AI-Assisted Setup으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:

터미널 창
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

그런 다음 아래 프롬프트를 사용하세요:

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

수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:

  1. 패키지 설치

    터미널 창
    bun add @capgo/capacitor-intune
  2. 네이티브 프로젝트 동기화

    터미널 창
    bunx cap sync
  3. 네이티브 Intune 설정 완료 전용 페이지를 iOS 설정 및 Android 설정 따라 진행하세요. Intune은 brokered auth, redirect URI, manifest, entitlement, MSAL 설정을 위해 여전히 호스트 앱의 네이티브 구성이 필요합니다.

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

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

자주 하는 실수

“흔한 실수” 섹션
  • 리스너: 화면이 언마운트될 때 핸들을 제거합니다.
  • 네이티브 동기화: 실행 bunx cap sync 플러그인 업그레이드 후.
  • 신뢰할 수 있는 소스: 신뢰 src/definitions.ts GitHub 레포지토리에서.
  • Capacitor 8+
  • Intune Android SDK를 사용하는 Android 12.0.3
  • Intune iOS SDK를 사용하는 iOS 21.5.1
  • iOS 배포 대상 17.0+

Ionic의 Intune 문서에 따르면, Xcode 26으로 빌드된 앱은 2026년 1월 19일 이후 Intune iOS SDK가 필요합니다. 21.1.0+. 이 플러그인은 이미 사용하고 있습니다 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): Microsoft 로그인을 시작하고 토큰 및 계정 메타데이터를 반환합니다.
  • acquireTokenSilent(options): 기존 계정의 캐시된 토큰을 읽어옵니다.
  • registerAndEnrollAccount(options): MSAL 계정을 Intune에 등록하고 등록 프로세스를 트리거합니다.
  • loginAndEnrollAccount(): Intune이 로그인 및 등록 흐름을 제어하도록 합니다.
  • appConfig(user): 계정의 Intune 앱 구성 값을 읽어옵니다.
  • getPolicy(user): 계정의 현재 Intune 앱 보호 정책을 읽어옵니다.
  • groupName(user): 공통 GroupName 설정 헬퍼 값이 있으면 읽어옵니다.
  • sdkVersion(): 번들에 포함된 Intune 및 MSAL 버전을 확인합니다.
  • Web은 지원되지 않습니다.
  • iOS와 Android 모두 네이티브 프로젝트 구성이 추가로 필요합니다. cap sync.
  • Azure 등록, Intune 정책 할당, redirect URI, entitlements는 앱별로 유지됩니다.

사용 중이라면 시작하기 마이그레이션과 엔터프라이즈 운영을 계획하려면 다음과 연결하세요: @capgo/capacitor-intune 사용하기 @capgo/capacitor-intune 사용 시 네이티브 기능을 위해, Capgo 엔터프라이즈 Capgo Enterprise의 제품 워크플로우를 위해, Ionic Enterprise 플러그인 대안 Ionic Enterprise 플러그인 대안의 제품 워크플로우를 위해, Capgo 대안 Capgo 대안의 제품 워크플로우를 위해, 그리고 Capgo 컨설팅 Capgo Consulting의 제품 워크플로우를 위해.