Visual Studio Configure Azure AD Authentication sa

2019-09-09 13:58发布

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?

1条回答
来,给爷笑一个
2楼-- · 2019-09-09 15:01

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 :)

查看更多
登录 后发表回答