Joost Verhoog
Joost Verhoog

Reputation: 48

Visual Studio Configure Azure AD Authentication says Windows Authentication is configured when it isn't

I want to configured Azure AD Authentication on an existing MVC website. So I right-click the website in Visual Studio, and select "Configure Azure AD Authentication".

The wizard then says: "An incompatible authentication configuration was found in this project (Windows Authentication). The wizard cannot be used to configure authentication."

It even links me to the documentation page explaining the error. So I removed <authentication mode="Windows" /> from web.config and re-built the application. But the wizards keeps showing this message.

What needs to change so the wizard will proceed?

Upvotes: 0

Views: 1093

Answers (1)

Julien Corioland
Julien Corioland

Reputation: 1105

The authentication assistant checks for both authentication section and a line that indicates to use Windows authentication with IISExpress, in the .csproj directly:

<IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>

Make sure to remove all authentication nodes in the web.config. Then unload your project (right click unload, in the solution explorer). Edit the project file (right click, Edit, once unloaded) and mark IISExpressWindowsAuthentication as disabled:

<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>

Reload your project, rebuild and then reopen the AD Authentication assistant.

It should work now :)

Upvotes: 3

Related Questions