authentication_ui_failed: The browser based authentication dialog failed to complete

2

Using below method query a token result in universal app: AcquireTokenAsync(string resource, string clientId, Uri redirectUri, PromptBehavior promptBehavior);

No problem in F5 debug mode, but hit error when installed the app manually by a published store app package.

the error message:

authentication_ui_failed: The browser based authentication dialog failed to complete. The system cannot locate the resource specified. (Exception from HRESULT: 0x800C0005)

win-universal-app
asked on Stack Overflow Mar 18, 2015 by Mosser Lee

2 Answers

4

Please check the capabilities of your universal app. Following capabilities must be enabled for AAD browser authentication UI popup to be shown:

  1. Enterprise Authentication
  2. Internet(Client & Server)
  3. Private Networks(Client & Server)
  4. Shared User Certificates

If you want to enable them from the package.appxmanifest xml file of your app you should have following entries inside Capabilities tag as below which corresponds to above capabilities in the same order:

<uap:Capability Name="enterpriseAuthentication"/>
<Capability Name="internetClient" />
<Capability Name="privateNetworkClientServer" />
<uap:Capability Name="sharedUserCertificates" />

Hope this helps!

answered on Stack Overflow Jul 1, 2015 by RBT
1

I got the same error message, although my problem was that I was using wrong redirectURI. Need to use the one generated by:

redirectURI = Windows.Security.Authentication.Web.WebAuthenticationBroker.GetCurrentApplicationCallbackUri();
answered on Stack Overflow Mar 23, 2017 by Eduardo Schuelter

User contributions licensed under CC BY-SA 3.0