重写发现页面中的URL(.well-known/openid-configuration) [英] Rewriting URLs in discovery page (.well-known/openid-configuration)

查看:593
本文介绍了重写发现页面中的URL(.well-known/openid-configuration)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在负载均衡器后面运行IdentityServer4,该负载均衡器将https调用重定向到http资源.这意味着我的IdentityServer将在http上运行,但需要在其发现页面(.well-known/openid-configuration)中显示https URL.

I have IdentityServer4 running behind a load balancer that redirects https calls to http resources. This means that my IdentityServer will be running on http but will need to show https URLs in it's discovery page (.well-known/openid-configuration).

将此页面上的http网址转换为https的最优雅的方法是什么?

What's the most elegant way to transform http urls on this page to https?

推荐答案

设置PublicOrigin选项(请参见文档).

services.AddIdentityServer( options => 
    options.PublicOrigin = "https://foo.bar.com" 
)
    .AddSigningCredential(...)
    .AddValidationKey(...)
    .AddInMemoryIdentityResources(...)
    .AddInMemoryClients(...)
    .AddProfileService<...>();

这篇关于重写发现页面中的URL(.well-known/openid-configuration)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆