AzureAD / azure-activedirectory-library-for-js

The code for ADAL.js and ADAL Angular has been moved to the MSAL.js repo. Please open any issues or PRs at the link below.
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/adal-angular
Apache License 2.0
627 stars 372 forks source link

ADAL For Xamarin Android Version 4.4.2 System.MissingMethod Exception #847

Closed Anubhab1991 closed 4 years ago

Anubhab1991 commented 5 years ago

**I am working on a Xamarin Android Project and was using Microsoft Active Directory nuget package version 4.4.0 to authenticate my app through MSAuthenticator.

But when i have upgraded the package to version 4.4.2 then i am getting a exception mentioned below

THIS IS WHAT I GET IN MY CONSOLE** [] 2018-12-27T12:24:39.0391640Z: 01192f1d-25a2-4f57-b03a-2940aab94e81 - AdalLoggerBase.cs: ADAL PCL.Android with assembly version '4.4.2.0', file version '4.4.2.0' and informational version '4.4.2' is running... [] 2018-12-27T12:24:39.0915220Z: 01192f1d-25a2-4f57-b03a-2940aab94e81 - AdalLoggerBase.cs: === Token Acquisition started: [] CacheType: null [] Authentication Target: User [] , Authority Host: login.microsoftonline.com [] 2018-12-27T12:24:39.1583590Z: 01192f1d-25a2-4f57-b03a-2940aab94e81 - AdalLoggerBase.cs: Exception type: System.MissingMethodException [] [] at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in :0 [] at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator.UpdateFromTemplateAsync (Microsoft.Identity.Core.RequestContext requestContext) [0x0002b] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 [] at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase+d60.MoveNext () [0x00017] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 [] --- End of stack trace from previous location where exception was thrown --- [] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0 [] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0 [] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0 [] at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0 [] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in :0 [] at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase+d53.MoveNext () [0x000ae] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0

Because of this it is not getting redirected to the Authenticator app. When i Downgrade again to package version 4.4.0 everything runs smooth.

BELOW IS THE EXCEPTION MESSAGE {System.MissingMethodException: Method 'string.TrimEnd' not found. at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in :0 at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator.UpdateFromTemplateAsync (Microsoft.Identity.Core.RequestContext requestContext) [0x0002b] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase+d60.MoveNext () [0x00017] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in :0 at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase+d53.MoveNext () [0x0069c] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in :0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in :0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in :0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext+<AcquireTokenCommonAsync>d__39.MoveNext () [0x000d7] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in :0 at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext+d__29.MoveNext () [0x0008b] in <0ca7acd3a30a40188ed7532e0d2c13ab>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in :0

jmckennon commented 4 years ago

I'm going to guess (please correct me if I'm wrong here) that this is meant for the Adal for Android team. I'll be closing this here. If this is still an issue and you do believe it is applicable to the JavaScript library, please comment again here, else this issue should be brought up with the Android team.