Asp.net core 如何获取声明WSFederation cookie auth?
任何未经身份验证的web api用户都需要连接到ADFS。身份验证通过。现在我如何从cookie中获取userid声明Asp.net core 如何获取声明WSFederation cookie auth?,asp.net-core,adfs,ws-federation,claims,Asp.net Core,Adfs,Ws Federation,Claims,任何未经身份验证的web api用户都需要连接到ADFS。身份验证通过。现在我如何从cookie中获取userid声明 public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddAuthentication(o => { o.DefaultScheme = CookieAuthenticat
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddAuthentication(o =>
{
o.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
o.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
o.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;
}).AddWsFederation(o =>
{
o.Wtrealm = Configuration["Federation:Wtrealm"];
o.MetadataAddress = Configuration["Federation:MetadataAddress"];
}).AddCookie();
return ContainerConfiguration.CreateAutofacServiceProvider(services);
}