C# Oidc can';使用api网关(ocelot)时找不到相关cookie

C# Oidc can';使用api网关(ocelot)时找不到相关cookie,c#,asp.net-core,openid-connect,ocelot,C#,Asp.net Core,Openid Connect,Ocelot,我正在使用oidc进行身份验证。我使用ocelot作为我的主要条目。因此,我将重定向uri添加到我的oidc事件设置中。但是,当我更改重定向URL时,我的微服务无法找到正确的关联cookie public static void AddOidcAuthentication(this IServiceCollection services, IConfiguration configuration) { var oidcConfig = configuration.

我正在使用oidc进行身份验证。我使用ocelot作为我的主要条目。因此,我将重定向uri添加到我的oidc事件设置中。但是,当我更改重定向URL时,我的微服务无法找到正确的关联cookie

   public static void AddOidcAuthentication(this IServiceCollection services, IConfiguration configuration)
    {

        var oidcConfig = configuration.GetSection<OidcConfiguration>();

        services.AddStoreCookieTicketInMemory();
        services.AddAuthentication(options =>
            {

                options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = "oidc";
                options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultForbidScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultSignOutScheme = CookieAuthenticationDefaults.AuthenticationScheme;

            })
            .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options =>
            {

                options.Cookie.Name = oidcConfig.CookieName;
                options.Cookie.SameSite = SameSiteMode.None;

            })
            .AddOpenIdConnect("oidc", options => {

                options.SignInScheme = "Cookies";
                options.Authority = oidcConfig.Authority;
                options.RequireHttpsMetadata = false;
                options.ClientId = oidcConfig.ClientId;
                options.ClientSecret = oidcConfig.ClientSecret;
                options.ResponseType = oidcConfig.ResponseType;
                options.Scope.Clear();

                oidcConfig.Scopes
                          .ToList()
                          .ForEach(scope => options.Scope.Add(scope));

                options.SaveTokens = true;
                options.Events = new OpenIdConnectEvents
                {
                    OnRedirectToIdentityProvider = context =>
                    {

                        context.ProtocolMessage.RedirectUri = "https://localhost:43500/microservice/signin-oidc";

                        return Task.FromResult(0);
                    }
                };

            });

    }
我知道它可以工作,但是它可以直接加载我的项目,而不是使用位于https://localhost:43500/.


提前谢谢

我想它确实与同一个站点的cookies有关。但我不确定。。!
 context.ProtocolMessage.RedirectUri = "https://localhost:43500/microservice/signin-oidc";