Skip to content

[Bug] MSAL.net does not return control to main activity #1863

@harmjonker

Description

@harmjonker

Which Version of MSAL are you using ?
MSAL.net 4.13.0

Platform
Xamarin Android

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive

Is this a new or existing app?
The app has just been converted from another OAUTH2 provider to MSAL, MS Authenticator and Azure AD.
We have deployed a first production candidate to 7 users in the field. 5 of them experience no issues, 2 of them experience the issue.

Repro
Reproduction circumstances are not clear. Issues occurs in production scenario's for two users. It is difficult to get precise description of circumstances with non-technical users.

Expected behavior
MSAL.net to return token

Actual behavior
Looks like MSAL.net does not return control to the main activity, this show up
Refer to application log with MSAL logging

At 2020-06-02 13:18:02.1210 it looks like MSAL does not return
16 seconds later the user decides to terminate the application.
Removing the Account manager account en restarting is a workaround!

Additional context/ Logs / Screenshots

2020-06-02 13:17:58.4578 Debug 1 LogWrapper.MinimalLogLevel change: Off => Debug
2020-06-02 13:17:58.5208 Info 1 ** Application MijnTeam, version 3.1.1.24 is initialized. **
2020-06-02 13:17:59.2716 Debug 1 Startup: supported: Tls12
2020-06-02 13:17:59.3963 Info 1 com.azure.authenticator - version 6.2004.2757
2020-06-02 13:17:59.4890 Debug 1 SigmaxApplication.OnActivityStarted(SplashActivity)
2020-06-02 13:17:59.4919 Debug 1 BackgroundService.Stop()
2020-06-02 13:17:59.4934 Debug 1 BackgroundService.Start() Set BackgroundServiceInProgress
2020-06-02 13:17:59.4943 Debug 1 BackgroundService.Start() Reset BackgroundServiceInProgress
2020-06-02 13:17:59.4950 Debug 1 MijnTeamApplicationSpecification.OnResume()
2020-06-02 13:17:59.5730 Error 1 Failed to get property ClearBackHistory of node Plannenscherm
2020-06-02 13:17:59.5744 Error 1 Failed to get property ClearBackHistory of node BegeleidingenOverzicht
2020-06-02 13:17:59.5758 Error 1 Failed to get property ClearBackHistory of node Informatiescherm
2020-06-02 13:17:59.8954 Debug 1 StorageServiceBase.Load(): [/storage/emulated/0/Android/data/nl.ns.mijnteam/files/config/begeleidingen.dat] geladen
2020-06-02 13:17:59.8959 Debug 1 BegeleidingenStorageService.Load(): ok
2020-06-02 13:17:59.8998 Info 1 BegeleidingenService.RemoveInvalid(): [0/0] begeleidingen opgeruimd
2020-06-02 13:17:59.9011 Info 1 BegeleidingenService.Cleanup(): [0/0] begeleidingen opgeruimd
2020-06-02 13:17:59.9037 Warn 1 BegeleidingenService(): 0 begeleidingen geladen
2020-06-02 13:17:59.9683 Info 1 Init progres : Omgeving instellen 4 %
2020-06-02 13:18:00.1133 Debug 1 MainAppActivity OnCreate()
2020-06-02 13:18:00.2473 Debug 1 BaseActivity.OnStart(MainAppActivity)
2020-06-02 13:18:00.2481 Debug 1 SigmaxApplication.OnActivityStarted(MainAppActivity)
2020-06-02 13:18:00.2497 Debug 1 BaseActivity.RunOnUiThread(): old fragment null
2020-06-02 13:18:00.2502 Debug 1 BaseActivity.RunOnUiThread(): new fragment MijnTeam.Fragments.LaadSchermFragment
2020-06-02 13:18:00.2659 Debug 1 BaseActivity.RunOnUiThread() remove all views
2020-06-02 13:18:00.2701 Debug 1 BaseActivity.RunOnUiThread() replace with fragment MijnTeam.Fragments.LaadSchermFragment
2020-06-02 13:18:00.3063 Info 4 OtapClient.WaitForActivity(): duration: 293,5828 ms
2020-06-02 13:18:00.3079 Warn 4 OtapClient.EnsureOtap(): StartMijnOmgeving()
2020-06-02 13:18:00.3173 Debug 1 BaseActivity.RunOnUiThread() done MijnTeam.Fragments.LaadSchermFragment
2020-06-02 13:18:00.3265 Info 4 OtapClient: MijnOmgeving activity kon niet worden gevonden
2020-06-02 13:18:00.3338 Debug 1 MainAppActivity.OnActivityResult(1200 - Canceled)
2020-06-02 13:18:00.3365 Info 1 OtapClient: Productie
2020-06-02 13:18:00.3370 Warn 1 OtapClient.OnActivityResult(1200): resultCode Canceled forced to Producie
2020-06-02 13:18:00.3373 Info 4 OtapClient.EnsureOtap(): duration: 28,531 ms
2020-06-02 13:18:00.3413 Info 4 Init progres : Controleren op geldige inlog 6 %
2020-06-02 13:18:00.3422 Debug 4 LaadschermViewModel.StartupServicesAsync(): LoginSilentAsync()
2020-06-02 13:18:00.3476 Info 4 Account.LoginSilentAsync(): initiate SilentTokenRequest >>
2020-06-02 13:18:00.3532 Info 4 Account.LoginSilentAsync(RoleCount 1): initiate SilentTokenRequest
2020-06-02 13:18:00.3556 Info 4 Account.LoginServiceBase.Execute()
2020-06-02 13:18:00.3587 Info 4 Account.LoginServiceBase.Execute() create new login task Silent
2020-06-02 13:18:00.3606 Info 4 Account.LoginServiceBase.Execute() Start login task Silent
2020-06-02 13:18:00.3742 Debug 6 Account.GetTokenSilentAsync() >>
2020-06-02 13:18:00.4341 Debug 1 SigmaxApplication.OnActivityStopped(SplashActivity)
2020-06-02 13:18:00.7169 Info 6 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:00] (UnknownClient: 0.0.0.0) Looper.MainLooper returned: Looper (main, tid 2) {25d9400}
2020-06-02 13:18:00.8257 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:00] (UnknownClient: 0.0.0.0) Using broker protocol version: 3.0
2020-06-02 13:18:00.8518 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:00] (UnknownClient: 0.0.0.0) Looper.MainLooper returned: Looper (main, tid 2) {25d9400}
2020-06-02 13:18:01.4825 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01] (UnknownClient: 0.0.0.0) Found 1 accounts in the account manager.
2020-06-02 13:18:01.4955 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) MSAL MSAL.Xamarin.Android with assembly version '4.13.0.0'. CorrelationId(3b727a70-cdfa-4c6d-80fd-c940fcae1141)
2020-06-02 13:18:01.5117 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) === AcquireTokenSilent Parameters ===
2020-06-02 13:18:01.5123 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) LoginHint provided: False
2020-06-02 13:18:01.5136 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) Account provided: True
2020-06-02 13:18:01.5141 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) ForceRefresh: False
2020-06-02 13:18:01.5474 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0)
=== Request Data ===
Authority Provided? - True
Scopes - api://WS20mijnteam-p.mobile-apps.ns.nl/.default offline_access
Extra Query Params Keys (space separated) -

2020-06-02 13:18:01.5493 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentRequest) started:

Authority Host: login.microsoftonline.com

2020-06-02 13:18:01.5675 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01 - 3b727a70-cdfa-4c6d-80fd-c940fcae1141] (UnknownClient: 0.0.0.0) Can invoke broker. Will attempt to acquire token with broker.
2020-06-02 13:18:01.5828 Info 4 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01] (UnknownClient: 0.0.0.0) Looper.MainLooper returned: Looper (main, tid 2) {25d9400}
2020-06-02 13:18:01.6423 Info 6 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01] (UnknownClient: 0.0.0.0) Using broker protocol version: 3.0
2020-06-02 13:18:01.6586 Info 6 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01] (UnknownClient: 0.0.0.0) Looper.MainLooper returned: Looper (main, tid 2) {25d9400}
2020-06-02 13:18:01.8193 Info 6 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:01] (UnknownClient: 0.0.0.0) Found broker account in Android account manager using the provided login hint.
2020-06-02 13:18:02.1210 Info 6 MSAL Info False (False) MSAL 4.13.0.0 MSAL.Xamarin.Android 26 [06/02/2020 11:18:02] (UnknownClient: 0.0.0.0) Looper.MainLooper returned: Looper (main, tid 2) {25d9400}
2020-06-02 13:18:18.7910 Debug 1 MijnTeamApplication.OnTrimMemory() called level = UiHidden
2020-06-02 13:18:18.8030 Debug 1 BaseActivity.OnStop(MainAppActivity)
2020-06-02 13:18:18.8103 Debug 1 SigmaxApplication.OnActivityStopped(MainAppActivity)
2020-06-02 13:18:18.8134 Debug 1 BackgroundService.Start()
2020-06-02 13:18:18.8211 Debug 1 MijnTeamApplicationSpecification.OnSleep()
2020-06-02 13:18:18.8385 Debug 1 MainAppActivity OnDestroy()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions