Framework version: 4.0.1 UI: Blazor DB: EF Core
I'm attempting to locally test the subdomain tenant resolver as referenced in the documentation: https://docs.abp.io/en/abp/latest/Multi-Tenancy
I've taken the following steps, but am unable to make the URL resolve to a tenant:
Configure<AbpTenantResolveOptions>(options =>
{
options.AddDomainTenantResolver("{0}.myapptest.com");
});
Attempted to add the same code to MyAppBlazorModule.cs.
The AddDomainTenantResolver() method was not found - checking the source code this appears to be part of the NuGet package "volo.abp.aspnetcore.multitenancy". After installing the package, I get the following error, and the namespace will not resolve, so I had to abaondon adding the package to the Blazor project (I believe the message means that the package is not supported for use with Blazor):
NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'. MyApp.Blazor C:\Program Files\dotnet\sdk\5.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 387
Amended hosts file to add dummy domain (with tenant subdomain prefixes) and amended applicationhost.config to accept wildcards for the API and Blazor projects:
<binding protocol="https" bindingInformation="*:44395:" />
<binding protocol="https" bindingInformation="*:44307:" />
Changed all occurrences of 'localhost' in all launchsettings.json and appsettings.json files to use myapptest.com
Ran the DBMigrator project to ensure that identityserver records were updated
Ran the application. I can access the application splash page through the relevant URLs including tenant subdomain
However, when attempting to login, I recieved a 500 - 'Invalid redirect_uri' - which I believe is coming from IdentityServer. After doing some digging, I found that I had to add each URL with the client's subdomain specifically into the IdentityServerClientRedirectUris table in order to enable the redirect for login.. it appears from posts on stackoverflow the that these redirect URL configurations do not support wildcards. Should a tenant record be added automatically when a new tenant is created using a subdomain scheme, or do I need to handle this manually when a new tenant is added?
Once adding the URLs to the table with client subdomains, I can now log in - however, it always seems to log into the host and not the tenant.
What am I doing wrong?
It seems that a domain-based tenant resolver is not currently supported for ABP blazor WebAssembly, see: ABP.IO - Blazor WebAssembly - Tenant-specific login