コンテンツにスキップ

Android セットアップ

GitHub

アプリ プロジェクトのトップ レベルで、Intune Gradle プラグイン JAR をクラス パスに追加してください。 android/build.gradleプラグイン パッケージには、以下のものが含まれます。 buildscript また、Ionic が現在の Intune Android __CAPGO_KEEP_0__ リリース用に記載している Duo Maven フィードも含めてください。

  • android/ms-intune-app-sdk-android/GradlePlugin/com.microsoft.intune.mam.build.jar

Also include the Duo Maven feed that Ionic documents for current Intune Android SDK releases:

maven {
url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
name 'Duo-SDK-Feed'
}

In android/app/build.gradle:

apply plugin: 'com.microsoft.intune.mam'

And keep resource optimization disabled:

android.enableResourceOptimizations=false

3. 以下のファイルを提供 auth_config.json

Section titled “3. auth_config.jsonを提供”

Create android/app/src/main/res/raw/auth_config.json:

{
"client_id": "YOUR_CLIENT_ID",
"authorization_user_agent": "BROWSER",
"redirect_uri": "msauth://YOUR_PACKAGE/YOUR_SIGNATURE_HASH",
"broker_redirect_uri_registered": true,
"account_mode": "MULTIPLE",
"authorities": [
{
"type": "AAD",
"audience": {
"type": "AzureADMyOrg"
}
}
]
}

The plugin expects that file at runtime for both MSAL and the Intune auth callback.

アプリが既定のカスタムを定義していない場合 Applicationset:

<application
android:name="app.capgo.intune.IntuneApplication"
android:enableOnBackInvokedCallback="false">

アプリが既定のカスタムを定義している場合 Applicationextend MAMApplicationIntuneMamServiceAuthenticationCallback 5. ブローカーアUTHクエリとリダイレクトハンドリング onMAMCreate().

セクションのタイトル “5. ブローカーアUTHクエリとリダイレクトハンドリング”

パッケージ可視性クエリを追加する:Ionicドキュメントの

ブラウザ検出の意図

  • com.azure.authenticator
  • com.microsoft.windowsintune.companyportal
  • 5. ブローカーアUTHクエリとリダイレクトハンドリング

また追加 BrowserTabActivity あなたの msauth:// リダイレクト URI のホスト/パスを指定してください。MSAL はサインインのラウンドトリップを完了できます。

アプリレベルネイティブのセットアップが完了したら、Capacitor API はiOSと同じです。

import { IntuneMAM } from '@capgo/capacitor-intune';
const auth = await IntuneMAM.acquireToken({
scopes: ['https://graph.microsoft.com/.default'],
});
await IntuneMAM.registerAndEnrollAccount({
accountId: auth.accountId,
});

Androidのセットアップから続けてください

セクション「Androidのセットアップから続けてください」

Capacitorを使用している場合 Androidのセットアップ ネイティブプラグインの作業を計画する場合、Capacitorを接続してください Using @capgo/capacitor-intune for the native capability in Using @capgo/capacitor-intune Capgo Plugin Directory for the product workflow in Capgo Plugin Directory Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives