Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rewriting URLs in discovery page (.well-known/openid-configuration)

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).

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

like image 558
ArdAtak Avatar asked Jan 21 '26 04:01

ArdAtak


1 Answers

Set the PublicOrigin option (see docs).

services.AddIdentityServer( options => 
    options.PublicOrigin = "https://foo.bar.com" 
)
    .AddSigningCredential(...)
    .AddValidationKey(...)
    .AddInMemoryIdentityResources(...)
    .AddInMemoryClients(...)
    .AddProfileService<...>();
like image 99
McGuireV10 Avatar answered Jan 25 '26 05:01

McGuireV10



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!