none
UWP App - AAD login popup doesn't appear - says user canceled

    Question

  • Azure AD & I have a love/hate relationship - mostly hate.  This app has been working for months, but in the last week 3 tablets have suddenly stopped showing the AAD login when a webapi method is called.  Instead the method returns an AdalServiceException with a Message of "User canceled authentication".  I have remoted into all 3 tablets and there's no popup anywhere visible.  Restarting the app doesn't help and have even updated the app to a later version and that didn't help, BUT...if I uninstall my app and reinstall it the issue is resolved.

    Can anyone think of something that could cause this?  And/or something I can try the next time it happens? 

    Exception & stacktrace below, but I think it's just the standard "canceled" response.

    ex type = AdalServiceException

    errorCode = authentication_canceled
    ex.Message = User canceled authentication: 

          User canceled authentication
       at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.VerifyAuthorizationResult()
       at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenInteractiveHandler.<PreTokenRequest>d__8.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.IdentityModel.Clients.ActiveDirectory.AcquireTokenHandlerBase.<RunAsync>d__55.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenCommonAsync>d__54.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__45.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Oceaneering.Commons.Authentication.<GetToken>d__28.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Oceaneering.AssetIntegrity.Controls.LoginUserControl.<loginAndDownload>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
       at Oceaneering.AssetIntegrity.Controls.LoginUserControl.<Login_Click>d__9.MoveNext()

    Monday, March 13, 2017 8:43 PM

All replies

  • Could be an intermittent issue. If you like to know the root cause of the issue, your best bet would be to create a support ticket. You can create a support incident from the portal or from the link - https://docs.microsoft.com/en-in/azure/azure-supportability/how-to-create-azure-support-request


    Tuesday, March 14, 2017 5:51 PM
    Moderator
  • Hi Sadiqh,

    The fact that upgrading my app doesn't help, but uninstalling/reinstalling does seems like an important clue. Do you know anything about where/how Azure caches locally for AAD auth?    The uninstall/reinstall deletes the files under my app's installation so I think there must be something there that has become damaged to cause this problem.  Trying to find anything on the client I could clear next time to try and isolate the problem.

    I looked quickly the last time it happened, but the folders seemed mostly empty.  I had a user waiting so I couldn't debug for very long.  I want to be more prepared the next time!

    This issue seems to vague to enter a support ticket until I gather more info.  We have premier support, but we have a fixed amount of hours and my last issue (a sync problem between ADFS & 2 separate AAD systems ate up a bunch of hours), so I need to do more work on my side before submitting another ticket.

    Thanks for the reply!

    Tuesday, March 14, 2017 7:39 PM