My IdentityServer and ApiResource in the same project, and develop in sub domain like
a.myids.com
b.myids.com
c.myids.com
d.myids.com
I have reference this code, but only can config one IdentityServer address, how can I change the Authority property dynamic, follow current requestContext Uri?
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
// base-address of your identityserver
options.Authority = "a.myids.com";
options.Authority = "b.myids.com";
options.Authority = "c.myids.com";
options.Authority = "d.myids.com";
//.........
options.Authority = "subdomain.myids.com";
// options.Authority = could it be current request Uri ??
options.Audience = "resource1";
});
}
}
You can't. You don't change the authority per-request. You could try multiple JWT bearers, with different schemes names, one for every subdomain you're going to use, but this is not something we support.
You could try looking at how Orchard does multi-tenancy, that's generally what we recommend for this type of scenario.
Could you share me the the muti-tenancy main code of Orchard?
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.