【发布时间】:2017-08-25 18:21:37
【问题描述】:
我有一个 AuthorizationProvider 需要同时使用 Anonymous 和 Windows,但我似乎无法使用 Windows 挑战:
if (principal == null || principal.Identity == null || string.IsNullOrWhiteSpace(principal.Identity.Name))
{
context.OwinContext.Authentication.Challenge();
return Task.FromResult(0);
}
是否需要设置其他配置值才能使该行正常工作? :context.OwinContext.Authentication.Challenge();
任何想法为什么这不起作用?我需要能够获得仅在启用 Windows 的情况下可以正常工作的 Windows 主体,但还需要启用匿名以便能够访问提供程序中的其他端点。
【问题讨论】:
标签: c# asp.net .net asp.net-mvc identity