Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:
- ABP Framework version: vX.X.X
- UI Type: MVC
- Database System: EF Core (MySQL)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
Example:
For Host Domain
Authserver: accounts.test.com Web Server: test.com Api Server: api.test.com
When unauthorized user is making a webcall it calls api.test.com
For Tenant Domain
Authserver: subdomain.accounts.test.com Web Server: subdomain.test.com Tenant Api Server: subdomain.api.test.com
Issue: When unauthorized user is making a webcall from subdomain like subdomain.test.com it calls api.test.com Expected: When unauthorized user is making a webcall from subdomain like subdomain.test.com it should call subdomain.api.test.com
In angular it should not be an issue as it is specificing in the config file {0}.api.test.com
But in MVC it is not working
"RemoteServices": { "Default": { "BaseUrl": "https://{{tenantName}}.api.test.com/" (with or without tenantName interpolation it is not working) } }
I have verified below configuration are correct:
Also, please note api.test.com it works as it is host (Correct Behaviour) subdomain.api.test.com it works as it was created as tenant (Correct Behaviour) wrong.api.test.com it does not work as it was never created as tenant (Correct Behaviour as tenant does not exist with name "wrong")
Please help with temporary workaround or is it a bug?
6 Answer(s)
-
0
Hi,
This may be a problem
May I ask which version are you using?
-
0
I am having issue from version 7.0 to 7.4 major version, currently it is the same in 7.4.4
-
0
Hi,
Will this work for you(Add to MVC project)?
[Dependency(ReplaceServices = true)] [ExposeServices(typeof(IRemoteServiceConfigurationProvider))] public class MyRemoteServiceConfigurationProvider : IRemoteServiceConfigurationProvider { protected AbpRemoteServiceOptions Options { get; } protected IAppUrlProvider AppUrlProvider { get; } public MyRemoteServiceConfigurationProvider( IOptionsMonitor<AbpRemoteServiceOptions> options, IAppUrlProvider appUrlProvider) { AppUrlProvider = appUrlProvider; Options = options.CurrentValue; } public async Task<RemoteServiceConfiguration> GetConfigurationOrDefaultAsync(string name) { var configuration = Options.RemoteServices.GetConfigurationOrDefault(name); configuration.BaseUrl = await AppUrlProvider.NormalizeUrlAsync(configuration.BaseUrl); return configuration; } public async Task<RemoteServiceConfiguration?> GetConfigurationOrDefaultOrNullAsync(string name) { var configuration = Options.RemoteServices.GetConfigurationOrDefaultOrNull(name); if (configuration != null) { configuration.BaseUrl = await AppUrlProvider.NormalizeUrlAsync(configuration.BaseUrl); } return configuration; } }
-
0
-
0
Hi,
We will fix it in the next patch version, your ticket has been refunded.
-
0
Thank you for refund and closing the ticket.