IdentityServer4 如何修改绑定路径 ,修改.well-known/openid-configuration 返回的前缀

4.0已经删除了以下属性,所以这样不行

services.AddIdentityServer(options =>
{
    //4.0已经删除此属性
    options.PublicOrigin = "https://my.id.server";
});

 

正确的是直接使用ASP.NET Core转发标头方法:

app.Use(async (ctx, next) =>
{
    ctx.SetIdentityServerOrigin("https://www.baidu.com");
    await next();
});

或者

app.Use(async (ctx, next) =>
{
    ctx.Request.Scheme = "https";
    ctx.Request.Host = new HostString("www.baidu.com");
    await next();
});

 

posted @ 2022-07-01 16:19  开拓丿飞  阅读(263)  评论(0编辑  收藏  举报