2017-03-10 95 views
3

没有人有有Windows验证的IdentityServer4使用此IdentityServer4MVC客户端沿“世界你好”样品。IdentityServer4 Windows身份验证和ASP.Net MVC核心客户的 “Hello World”

我一直在网上搜索一个没有成功的例子,最近2天,最后在这里发布一个问题寻求帮助。 IdentityServer3有一个或两个使用Windows身份验证但不是IdentityServer4的示例。任何帮助将不胜感激。

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

+0

看看这里: http://hansamaligamage.blogspot.de/2017/02/secure-your-netcore-web-applications.html或https://github.com/hansamaligamage/ASP.NETCoreSecurity – Reinhard

+0

您上面的链接描述了资源所有者密码流。您是否有任何有关IdentityServer的Windows身份验证工作示例? –

回答

4

这个QuickStart有一个隐藏的样本。按照它并忽略谷歌身份验证。默认情况下,您将看到唯一的外部提供商是Windows验证码

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

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

    // etc ... 
} 

现在,你的客户将会被自动使用唯一可用的外部提供商(Windows验证),并有一个隐含的流程登陆当前Windows用户。