Hi,
I need to use ClaimsPrincipal with current tenant. Actually, there is no problem without tenant. I also used _currentTenant.Change but, it throws Volo.Abp.Authorization.AbpAuthorizationException when I call to PhaseAppservice as below. I need to access to appService in IDistributedEventHandler also.
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: v7.3.1
- UI Type: Angular / MVC
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes/
- Exception message and full stack trace:
- Steps to reproduce the issue:
3 Answer(s)
-
0
Hi,
Can you share the full error logs?
-
0
Hi,
Can you share the full error logs?
Hi,
Actually, current user has permission and it didn't throw exception from other appService with this tenant. It throwed exception when we use tenant just EventHandler.cs. So I think that we need to add tenant information in ClaimsPrincipal, is it possible or can you advice any other option? Thanks
-
0
You can try
claimsIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, eventData.TenantId.ToString()))