Reputation: 1764
PublicClientApplication.createMultipleAccountPublicClientApplication()
throws MsalClientException on some Android devices. In some devices everything works well.
Intune Company Portal app is installed in all the devices and acts as a broker app. The broker application view is not displayed in devices affected by the issue.
What could be the reason why it works on some devices and not in others although all use the same code base and has same broker app installed?
Stack trace:
com.microsoft.identity.client.exception.MsalClientException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.microsoft.identity.client.internal.controllers.MsalExceptionAdapter.msalExceptionFromBaseException(MsalExceptionAdapter.java:51)
at com.microsoft.identity.client.PublicClientApplication$2.onError(PublicClientApplication.java:873)
at com.microsoft.identity.client.PublicClientApplication$2.onError(PublicClientApplication.java:870)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher$2.run(CommandDispatcher.java:176)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7860)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Caused by: com.microsoft.identity.common.exception.ClientException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.microsoft.identity.common.internal.controllers.ExceptionAdapter.baseExceptionFromException(ExceptionAdapter.java:252)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher.executeCommand(CommandDispatcher.java:142)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher.access$200(CommandDispatcher.java:52)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher$1.run(CommandDispatcher.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at com.microsoft.identity.client.internal.controllers.BrokerMsalController$5.putValueInSuccessEvent(BrokerMsalController.java:412)
at com.microsoft.identity.client.internal.controllers.BrokerMsalController$5.putValueInSuccessEvent(BrokerMsalController.java:392)
at com.microsoft.identity.client.internal.controllers.BrokerMsalController.invokeBrokerOperation(BrokerMsalController.java:221)
at com.microsoft.identity.client.internal.controllers.BrokerMsalController.getDeviceMode(BrokerMsalController.java:391)
at com.microsoft.identity.common.internal.controllers.GetDeviceModeCommand.execute(GetDeviceModeCommand.java:44)
at com.microsoft.identity.common.internal.controllers.GetDeviceModeCommand.execute(GetDeviceModeCommand.java:33)
at com.microsoft.identity.common.internal.controllers.CommandDispatcher.executeCommand(CommandDispatcher.java:137)
… 5 more
Upvotes: 0
Views: 1838
Reputation: 1764
Answering to my own question:
The issue was having old version of Intune Company Portal app in some mobile devices. After updating to latest version, it works.
Upvotes: 1
Reputation: 2746
I'm not sure if this is your issue, but here is one possible reason: under the docs, it states: This function will pass back an MsalClientException object if it is unable to return IMultipleAccountPublicClientApplication. For example, when the device is marked as 'shared' (PublicClientApplication#isSharedDevice() is set to true)
meaning if the device is a shared device mode device, then that call to createmultiple... will fail with that msal exception.. to check if its a shared device, according to here https://learn.microsoft.com/en-ca/azure/active-directory/develop/tutorial-v2-shared-device-mode#set-up-an-android-device-in-shared-mode you can check through azure portal
it could very well not be your issue, but just a thought / something to check.
Upvotes: 0