microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
45 stars 18 forks source link

After successful MSAL authentication, Intune enrollment attempt returns AUTHORIZATION_NEEDED #167

Closed Lackofa7742 closed 1 year ago

Lackofa7742 commented 1 year ago

Bug description

After successfully authenticating the user with MSAL, the attempt to register/enroll the user with Intune returns an AUTHORIZATION_NEEDED result. This appears to happen because the resource ID in the scope is incorrect according to the MAMService. However, the iOS equivalent appears to enroll successfully using the same scope. This is in a React Native app but all the Intune interaction happens on the native side.

Config JSON and Manifest

config

manifest

Error log

resourcelog

Scopes attempted

"<api-host>/user_impersonation" "<api-host>/DeviceManagementManagedApps.ReadWrite"

Lackofa7742 commented 1 year ago

I was able to fix this. The wrong resource ID was used.