IdentityServer4 Windows身份验证和ASP.Net核心MVC客户端"Hello World"

Tar*_*bhi 3 asp.net-core identityserver4

有没有人为具有Windows AuthIdentityServer4以及使用此IdentityServer4MVC客户端提供"hello world"示例.

在过去的两天里,我一直在网上搜索一个没有成功的例子,最后在这里发一个问题寻求帮助.IdentityServer3有一个或两个使用Windows Auth的示例,但不是IdentityServer4.任何帮助将受到高度赞赏.

我个人尝试使用Implitict流程的客户端的各种排列和组合,并使用docs.identityserver.io上的信息进行Windows Auth,但我遗漏了一些非常基本的感觉.我总是从MVC客户端获得401,它甚至没有挑战并转到ID4服务器.

小智 7

快速入门中有一个隐藏的示例.关注它并忽略Google Auth.默认情况下,您将看到唯一的外部提供程序是Windows Auth.

然后,你只需要设置为false AllowLocalLoginQuickstart\Account\AccountOptions.cs:

public class AccountOptions
{
    public static bool AllowLocalLogin = false;
    public static bool WindowsAuthenticationEnabled = true;

    // etc ...
}
Run Code Online (Sandbox Code Playgroud)

现在,您的客户端将自动使用唯一可用的外部提供程序(Windows Auth)并使用隐式流程登录当前的Windows用户.