Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core 如何获取声明WSFederation cookie auth?_Asp.net Core_Adfs_Ws Federation_Claims - Fatal编程技术网

Asp.net core 如何获取声明WSFederation cookie auth?

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

任何未经身份验证的web api用户都需要连接到ADFS。身份验证通过。现在我如何从cookie中获取userid声明

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);
}