Search code examples
adal

How to dismiss ADAuthentication web view controller programmatically?


I met the following issue after dismiss the webveiwcontroller from ADAL programmably, and next time when I re-launch the sign in flow, I was given the following errors:

error=Error with code: 13 Domain: ADAuthenticationErrorDomain ProtocolCode:(null)
Details:The user is currently prompted for credentials as result of another acquireToken request.
Please retry the acquireToken call later..
Inner error details: Error Domain=ADAuthenticationErrorDomain Code=13
"The operation couldn’t be completed. (ADAuthenticationErrorDomain error 13.)"

If I close the app completely and reopen it, the sign in flow works again. Is this a known issue and what could be used to work around this?

Thanks


Solution

  • You should call ADAuthenticationBroker->cancel to make sure all the locks are released correctly.