/sample-intune-maui-ios

An open-source sample app.

Primary LanguageC#MIT LicenseMIT

sample-intune-maui-ios

Both applications are a demonstration of the Microsoft Intune App SDK for MAUI.iOS. A developer guide to the SDK is available here.

They use the Microsoft Authentication Library to authenticate users.

The IntuneMAMiOSMauiSample is an example of a .NET MAUI application. The IntuneMAMiOSDotNetSample is an example of a .NET iOS application.

Steps to run the app

In order to deploy this sample you will need an Intune subscription. Free trials are sufficient for this demo.

These steps will need to be completed for each sample app.

Step 1: Setting up AAD registration

To sign in with MSAL, you will need to register with Azure Active Directory (AAD) to create a client ID, redirect URI, and request your app permission to access the Mobile Application Management (MAM) service for your tenant.

  1. Create an AAD app registration by following the steps in our developer guide here.
  2. Replace the three placeholder values in the Info.plist with the AAD client ID, redirect URI (ex: msauth.com.maui.microsoftintunemamsample://auth), and redirect URI scheme (ex: msauth.com.maui.microsoftintunemamsample).
  3. Follow the last step in the Configure MSAL settings for the Intune App SDK section of our developer guide to request your app permission to the MAM service. You may need to grant your tenant's permission with an admin account after doing this.

Step 2: Setting up Intune

You will need at least one user assigned to a user group. You can see how to create new users here and user groups here. Be sure to assign Intune licenses to your users here.

Step 3: Create and Deploy App Protection Policy (APP)

To enable MAM without device enrollment (MAM-WE), we must create a new App Protection Policy with Intune. Instructions for creating and deploying a new APP can be found here.

  1. To create an APP targeting the sample app, click on Create policy in the "App protection policies" pane.
  2. In the "Create policy" pane specify the protection policy name, description, and platform. Click on Select required apps.
  3. At the top of the pane click More apps and scroll to the bottom of the pane.
  4. Enter the Bundle ID of your app and click Add. The bundle ID can be found by in the Info.plist (ex: com.maui.microsoftintunemamsample).
  5. Hit Select at the bottom of the "Apps" pane.
  6. Click the Settings button in the "Create policy" pane and set the policy settings you would like to apply to a user group for your app.
  7. Once you have selected the settings click OK at the bottom of the Settings pane and then click Create at the bottom of the "Create policy" pane. Your app should now appear in the "App protection policies" pane.

Step 4: Launch the App & Sign-In

The sample app should now be properly configured with Intune. Enter the email of one of the users in the group used in Step 2 or Step 3 and select Login to trigger the enrollment.