【问题标题】:IdentityServer4 Windows Authentication and ASP.Net Core MVC Client "Hello World"IdentityServer4 Windows 身份验证和 ASP.Net Core MVC 客户端“Hello World”
【发布时间】:2017-03-14 17:55:49
【问题描述】:

有没有人有 “hello world” 示例,用于具有 Windows Auth 的 IdentityServer4 以及使用此 IdentityServer4MVC 客户端。

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

我亲自尝试了使用隐式流和使用 docs.identityserver.io 上的信息进行 Windows Auth 的客户端的各种排列和组合,但我缺少一些我觉得非常基本的东西。我总是从 MVC 客户端得到 401,它甚至没有挑战并转到 ID4 服务器。

【问题讨论】:

标签: asp.net-core identityserver4


【解决方案1】:

QuickStart 中有一个隐藏样本。跟随它并忽略谷歌身份验证。默认情况下,您会看到唯一的外部提供程序是 Windows Auth

那么你只需要在Quickstart\Account\AccountOptions.cs 中设置false AllowLocalLogin

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

    // etc ...
}

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

【讨论】:

    猜你喜欢
    • 2020-12-20
    • 1970-01-01
    • 2017-06-27
    • 2018-01-02
    • 1970-01-01
    • 2021-05-26
    • 2016-06-09
    • 1970-01-01
    • 2018-02-12
    相关资源
    最近更新 更多