Microsoft-authentication-library-for-dotnet: [Bug] Xamarin.Android authentication fails since 4.8.0

Created on 21 Jan 2020  路  7Comments  路  Source: AzureAD/microsoft-authentication-library-for-dotnet

Which Version of MSAL are you using ?
MSAL 4.8.0 (bug not present with v4.7.1)

Platform
Xamarin.Android

What authentication flow has the issue?

  • Desktop / Mobile

    • [X] Interactive

    • [ ] Integrated Windows Auth

    • [ ] Username Password

    • [ ] Device code flow (browserless)

Repro

authResult = await clientApplication.AcquireTokenInteractive(Scopes)
   .WithParentActivityOrWindow(myActivity)
   .ExecuteAsync();

Expected behavior
User can enter login credentials and AcquireTokenInteractive method returns with authResult

Actual behavior
AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs throws exception and AcquireTokenInteractive does not return with a value

Additional context/ Logs / Screenshots
image

Fixed P0 bug

Most helpful comment

@tipa @Daniel-NP issue has been fixed and merged into master. we are working on getting a release out. thanks for reporting this.

All 7 comments

Thanks for reporting @tipa, we did some work to integrate the Android broker and our Android integration tests obviously need some work :).

@jmprieur @henrik-me - this and https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/1586 suggest we need to do a full test pass on Xamarin scenarios. I suggest we unlist version 4.8.0 from NuGet, as it is likely not usable.

Just wanted to post the same issue. Good to know that it's not my fault. @bgavrilMS I agree with you, unlisting would make sense.

EDIT: This is my Stacktrace:

System.NullReferenceException
Nachricht = Object reference not set to an instance of an object.

at Microsoft.Identity.Client.Platforms.Android.AndroidBroker.SetBrokerResult (Android.Content.Intent data, System.Int32 resultCode) [0x00054] in <8d2180a2dc4f4b4a93def7b0ee254410>:0 
at Microsoft.Identity.Client.AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs (System.Int32 requestCode, Android.App.Result resultCode, Android.Content.Intent data) [0x00028] in <8d2180a2dc4f4b4a93def7b0ee254410>:0 
at App1.Mobile.Droid.MainActivity.OnActivityResult (System.Int32 requestCode, Android.App.Result resultCode, Android.Content.Intent data) [0x0000b] in C:\Source\App1\App1.Mobile.Droid\MainActivity.cs:44 
at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 requestCode, System.Int32 native_resultCode, System.IntPtr native_data) [0x00014] in <d706cf8faf5542949900cf6d57864528>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.7(intptr,intptr,int,int,intptr)`

@bgavrilMS I agree that we should unlist 4.8.0, but we also have to re-update the samples (which were updated to 4.8.0)

Well the samples will continue to work, minus the Xamarin sample which we didn't update anyway. Once we release 4.8.1 we will update the samples to that. Unlisting is more like hiding, the package is still there.

But I agree that it might be safer to revert the samples.

Unlisted
image

@tipa @Daniel-NP issue has been fixed and merged into master. we are working on getting a release out. thanks for reporting this.

Was this page helpful?
0 / 5 - 0 ratings