0
dhill created
- ABP Framework version: v8.2.0
- UI Type: Blazor Server
- Database System: EF Core
- **Azure Web App with AzureSignalR We've successfully implemented subdomain tenant mapping. However, when using linked accounts the subdomain does not change when the tenant change happens. How can we get the subdomain url to reflect the change in tentant?
Here is our WebModule configuration.
PreConfigure<OpenIddictBuilder>(builder =>
{
_ = builder.AddValidation(options =>
{
_ = options.AddAudiences("SafetyPlusWeb");
_ = options.UseLocalServer();
_ = options.UseAspNetCore();
});
});
if (!hostingEnvironment.IsDevelopment())
{
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
{
// In production, it is recommended to use two RSA certificates,
// one for encryption, one for signing.
_ = serverBuilder.AddEncryptionCertificate(
GetEncryptionCertificate(context.Services.GetConfiguration()));
_ = serverBuilder.AddSigningCertificate(
GetSigningCertificate(context.Services.GetConfiguration()));
});
var domainFormat = GetDomainFormatForEnvironment(hostingEnvironment);
PreConfigure<AbpOpenIddictWildcardDomainOptions>(options =>
{
options.EnableWildcardDomainSupport = true;
_ = options.WildcardDomainsFormat.Add($"https://{domainFormat}");
_ = options.WildcardDomainsFormat.Add($"https://{domainFormat}/signin-oidc");
_ = options.WildcardDomainsFormat.Add($"https://{domainFormat}/signout-callback-oidc");
});
}
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
var domainFormat = GetDomainFormatForEnvironment(hostingEnvironment);
Configure<AbpTenantResolveOptions>(options =>
{
options.AddDomainTenantResolver(domainFormat);
});
if (!configuration.GetValue<bool>("App:DisablePII"))
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
}
if (!configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata"))
{
Configure<OpenIddictServerAspNetCoreOptions>(options =>
{
options.DisableTransportSecurityRequirement = true;
});
}
if (!hostingEnvironment.IsDevelopment())
{
_ = context.Services.AddSignalR(options =>
{
options.AddFilter<AbpMultiTenantHubFilter>();
}).AddAzureSignalR();
}
ConfigureOptions(context, configuration);
ConfigureAuthentication(context);
ConfigureUrls(configuration);
ConfigureBundles();
ConfigureImpersonation(context, configuration);
ConfigureAutoMapper();
ConfigureVirtualFileSystem(hostingEnvironment);
ConfigureMultiTenancy();
ConfigureSwaggerServices(context.Services);
ConfigureExternalProviders(context, configuration);
ConfigureAutoApiControllers();
ConfigureBlazorise(context);
ConfigureRouter(context);
ConfigureMenu(context);
ConfigureCookieConsent(context);
ConfigureAuditingOptions(context);
ConfigureTheme();
Configure<SettingManagementComponentOptions>(options =>
{
options.Contributors.Add(new SafetyPlusWebSettingsComponentContributor());
});
if (!hostingEnvironment.IsDevelopment())
{
Configure<AbpTenantResolveOptions>(options =>
{
options.AddDomainTenantResolver(domainFormat);
});
}
}
```
8 Answer(s)
-
0
Hi,
You can try
Configure<AbpAccountOptions>(options => { options.IsTenantMultiDomain = true; options.GetTenantDomain = (httpContext, info) => Task.FromResult(string.IsNullOrWhiteSpace(info.Name) ? $"https://getabp.net" : $"https://{info.Name}.getabp.net"); });
-
0
hi we reopened this ticket per your request
-
0
Hi,
I tried adding that code but it didn't actually refresh the url in the browser.
Is this something that has to happen on the client wasm side with blazor full stack?
-
0
Add to your auth server project
Configure<AbpAccountOptions>(options => { options.IsTenantMultiDomain = true; options.GetTenantDomain = (httpContext, info) => Task.FromResult(string.IsNullOrWhiteSpace(info.Name) ? $"https://getabp.net" : $"https://{info.Name}.getabp.net"); });
-
0
We don't have an auth server project. Only the Blazor and Blazor.Client projects.
-
0
Hi,
okay, add to
Blazor
projectif still not work, please let me know, i will check it.
-
0
Looks like that worked :)
We need to do a bit more integration testing to know for sure though.
-
0
This looks like it's working correctly now. Thanks!