Not able to enable CORS for identity server 4 in asp.net core

前端 未结 2 689
花落未央
花落未央 2021-01-13 02:51

Ok, I have added CORS policy for my dot net core APIs but somehow these CORS policies are not working for identity server 4 endpoints. I have following api where I try to r

2条回答
  •  心在旅途
    2021-01-13 03:16

    This works for the newer version of the server.

        services.AddSingleton((container) => {
            var logger = container.GetRequiredService>();
            return new DefaultCorsPolicyService(logger)
            {
                AllowAll = true
            };
        });
    

    more details here at this discussion, with credit to the original author

    https://github.com/IdentityServer/IdentityServer4/issues/4685

提交回复
热议问题