L.T.
L.T.

Reputation: 683

Azure Active directory authentication got error "we can't connect to the service you need right now"

I have a windows store app (8.1) using Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext to do authentication.

When the program call AcquireTokenAsync, it will bring up a login screen to let user enter a company email then redirect to a company azure ad site to enter password.

If I run this app on a cloud vm (not domain joined) or a domain join company computer (windows 10) within visual studio, it will be fine, the password entry page will show up.

My problem is when I sideload this app to run on the same company pc, it will show an error message "we can't connect to the service you need right now." after the email entered. And from the event log of webAuth, it shows "AuthHost encountered a navigation error at URL".

I have declare the capabilities in the manifest for Enterprise Authentication Internet(client & server) Private Networks (client & server) Shared User Certificates as this link suggested.

Anyone got better ideas what may cause this problem?

Upvotes: 2

Views: 891

Answers (1)

L.T.
L.T.

Reputation: 683

Tried a few things, finally come to this article. I edited registry and added this key. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\authhost.exe\EnablePrivateNetwork = 00000001

After that, Web authentication broker start working as it should be.

Upvotes: 2

Related Questions