- ABP Framework version: v4.3.3
- UI type: Angular
- DB provider: EF Core (mssql)
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"In a project we have monality (AbpView), this project includes identity server saas and Administration service modules. The version of this project is v4.3.3. Later, we added a microservice project v7.0.1 (SupplierEvaluation) to this project as an additional community. In these two projects, we are routing with gateway.However, in our project, we obtain jwt tokens by connecting the data we pulled from the 2nd project to that project (AbpView) in the ID, and this token also has a tenantId information.With this jwt we can get tenant owner data from AbpView (monalite) project, but not 'tenant owner data' from Supplier evaluation (microservice project). The problem may be caused by the cause.Thanks in advance."
13 Answer(s)
-
0
Hi,
According to my understanding:
You can use the JWT to get tenant owner data from Monalite but not SupplierEvaluation.
What's the result if you output the
ICurrentTenant.Id
in the SupplierEvaluation project? -
0
Hi ,
The id and name coming from the ICurrentTenant interface are null.Why is the reason we can't get Tenant information from our supplierevaluation?In addition, in order to solve this situation, we injected the Tenant management module for the SupplierEvaluation service, implanted the ITenantDbContext interface in DbContext, added tables to the database and added tenants manually. The situation was temporarily resolved.Can a different action be taken from this situation? Or is it appropriate to solve this situation?
-
0
Hi,
Here are two ways:
1
Install the saas domain and entityframeworkcore packages. Set the connection string to read tenant data from the Monalite database: https://docs.abp.io/en/abp/latest/Connection-Strings#configuring-the-database-structures
"ConnectionStrings": { "Saas": "Server=localhost;Database=MyMainDb;Trusted_Connection=True;" }
2
Load the tenant data from the remote service(SupplierEvaluation > gateway > Monalite) You need to install the
Volo.Abp.AspNetCore.Mvc.Client
package, it provides the MvcRemoteTenantStore class- You should configure the Remote service in the
SupplierEvaluation
project.
{ "RemoteServices": { "Default": { "BaseUrl": "http://localhost:53929/" (gateway) } } }
- You should configure the gateway to forward the request
{ "ServiceKey": "Multi-tenancy Service", "DownstreamPathTemplate": "/api/abp/multi-tenancy/{everything}", "DownstreamScheme": "https", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 44367 (Monalite) } ], "UpstreamPathTemplate": "/api/abp/multi-tenancy/{everything}", "UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ] },
- You should configure the Remote service in the
-
0
-
0
Hi,
I'd like check it remotely, can we have a meeting via zoom? shiwei.liang@volosoft.com
-
0
Hi ,
Ok. When should we schedule a meeting?I sent you an e-mail for meeting about.
-
0
Hi,
I don't see the correct configuration.
You can try:
- Remove
Volo.Abp.TenantManagement.EntityFrameworkCore
fromSupplierEvaluation.HttpApi.Host
project. - Install
Volo.Abp.AspNetCore.Mvc.Client
package to theSupplierEvaluation.HttpApi.Host
project - Add
typeof(AbpAspNetCoreMvcClientModule)
to theSupplierEvaluationHttpApiHostModule
- Configure remote service in the
appsettings.json
ofSupplierEvaluation.HttpApi.Host
project.
{ "RemoteServices": { "Default": { "BaseUrl": "https://....." (gateway URL) } } }
- Remove
-
0
-
0
Hi,
I made an example and share it to you, you can check it.
-
0
-
0
-
0
-
0
Do not use the routing middleware in the gateway.
If you use routing middleware, it will handle the request itself instead of forwarding to the service