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);
});
}
}
```
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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"); });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
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"); });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
okay, add to
Blazorprojectif still not work, please let me know, i will check it.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)