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)
Please check the capabilities of your universal app. Following capabilities must be enabled for AAD browser authentication UI popup to be shown:
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!
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();
User contributions licensed under CC BY-SA 3.0