AzureAD / microsoft-authentication-library-common-for-android

Common code used by both the Active Directory Authentication Library (ADAL) and the Microsoft Authentication Library (MSAL)
MIT License
41 stars 35 forks source link

NPE at com.microsoft.identity.common.internal.ui.browser.BrowserSelector.isFullBrowser(BrowserSelector.java:236) #2084

Open zeeshanjamal opened 1 year ago

zeeshanjamal commented 1 year ago

I am integrating Intune SDK(with MSAL) on my android application. I am able to login via MSAL and am also seeing the Microsoft Intune's consent screen where i have to specify the pin. After both these steps application crashes with the exception trace below. I am using the latest Intune SDK(9.7.0), android api version is 33 and MSAL is 4.6.1. Due to this i am not getting ENROLLMENT_SUCCEEDED intune notification at the end. I am using Capacitor with react.

at com.microsoft.identity.common.internal.ui.browser.BrowserSelector.isFullBrowser(BrowserSelector.java:236) at com.microsoft.identity.common.internal.ui.browser.BrowserSelector.getBrowsers(BrowserSelector.java:199) at com.microsoft.identity.common.internal.ui.browser.BrowserSelector.getDefaultBrowser(BrowserSelector.java:144) at com.microsoft.identity.common.internal.ui.browser.BrowserSelector.select(BrowserSelector.java:79)

zeeshanjamal commented 1 year ago

IntentFilter is null in ResolveInfo. Same issue as mentioned in this post: Android msal login failed

Similar issue as mentioned in below post as well but that is in Open ID App auth package of android. NPE on isFullBrowser method . They fixed it by adding null check on Intent Filter of ResolveInfo.

zeeshanjamal commented 1 year ago

I was able to fix it by setting "authorization_user_agent" : "WEBVIEW". Earlier it was set to "DEFAULT. But I am still curious about a null check. Do we still need that?