Identityserver4: Where is PublicOrigin option now?

Created on 19 Jun 2020  路  4Comments  路  Source: IdentityServer/IdentityServer4

Question

After upgrade to 4.0.0, the following option is gone. Where is it now?

Minimal working example

    services.AddIdentityServer(options =>
    {
        options.PublicOrigin = "https://my.id.server";
    });
question

Most helpful comment

All it did was setting the host and scheme to a hard-coded value.

You can easily replace it with

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

or

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

    await next();
});

Put that at the beginning of your pipeline.

All 4 comments

It's gone. It was a hack - please use the forwarded headers approach in ASP.NET Core from now on.

hack that worked. forwarded headers approach never worked for me on ngix.... facing same issue again

All it did was setting the host and scheme to a hard-coded value.

You can easily replace it with

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

or

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

    await next();
});

Put that at the beginning of your pipeline.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings