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
C# .NET核心WS-Federation:如何在请求中排除Wreply作为参数?_C#_Asp.net Core_Ws Federation - Fatal编程技术网

C# .NET核心WS-Federation:如何在请求中排除Wreply作为参数?

C# .NET核心WS-Federation:如何在请求中排除Wreply作为参数?,c#,asp.net-core,ws-federation,C#,Asp.net Core,Ws Federation,我有一个.NET MVC应用程序,它根据WS-Fed服务进行身份验证,我现在正试图从.NET核心应用程序连接到同一个服务。它不起作用,当我要求服务提供商查看日志时,他们说这是因为我放错了地址。放置“正确”的回复URI似乎没有什么帮助,经过检查,我注意到我没有在.NET应用程序中提供Wreply,它没有作为参数包含在请求中,但它可以工作 我在.NETCore中也尝试过这样做,但根据文档,如果不向配置中添加Wreply值,它默认为从中调用的URI。这似乎是个问题,如果我能从我的.NET核心请求中删除

我有一个.NET MVC应用程序,它根据WS-Fed服务进行身份验证,我现在正试图从.NET核心应用程序连接到同一个服务。它不起作用,当我要求服务提供商查看日志时,他们说这是因为我放错了地址。放置“正确”的回复URI似乎没有什么帮助,经过检查,我注意到我没有在.NET应用程序中提供Wreply,它没有作为参数包含在请求中,但它可以工作

我在.NETCore中也尝试过这样做,但根据文档,如果不向配置中添加Wreply值,它默认为从中调用的URI。这似乎是个问题,如果我能从我的.NET核心请求中删除Wreply,它应该可以工作,但我找不到任何方法来做到这一点。我尝试过根本不设置Wreply,也将其设置为空字符串。以下是我在ConfigureServices中拥有的内容:

        public void ConfigureServices(IServiceCollection services)
    {
        IdentityModelEventSource.ShowPII = true;
        services.AddAuthentication(sharedOptions =>
        {
            sharedOptions.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;
            sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
        })
         .AddWsFederation(options =>
         {
             options.MetadataAddress = "https://redacted.com/metadata.xml";
             options.Wtrealm = "https://redacted-realm.org";
             options.Wreply = "";
         })
         .AddCookie();

        services.AddControllersWithViews();
    }

我建议您可以使用fiddler检查请求,并与asp.net和asp.net core比较它们之间的区别。虽然您没有设置,但asp.net core似乎总是会生成wreply。因此,如果您不在应用程序中注册它或设置null,它们将不匹配。