Hi,
We implemented the Blazor app as a SaaS.
I have a user account in all the Tenants and Linked the accounts. able to switch tenants and able to access the data.
And i am as a SaaS user I should be able to access all the Tenants Data in Dashboard. am bale to get the all the Tenants data and showing in Dashboard.
But When I click on a link of the item am unable to read the data since am might in that record Tenant currently.
So when ever i click on link of the item before loading the details if the record not from current tenant then in background I should be switch the user related to that Tenant of record.
something like below, make use of the API's of "Login as this account" in linked users.
if (tenantid == Guid.Empty) tenantid = null;
if (CurrentTenant.Id != tenantid)
{
// TODO:
//Switch the User
}
can you please help on this?
If you're creating a bug/problem report, please include followings:
- ABP Framework version: v5.3.4
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
1 Answer(s)
-
0
Hi,
The link login API URL is
/account/LinkLogin?SourceLinkUserId=xxx&SourceLinkTenantId=xxx.......
.Parameters:
SourceLinkUserId
: Should be the current user IdSourceLinkTenantId
: Should be the current tenant IdSourceLinkToken
TargetLinkUserId
: The user Id you want to switchTargetLinkTenantId
: The tenant Id you want to switch
You can use the
GenerateLinkTokenAsync
method ofIIdentityLinkUserAppservice
to get the SourceLinkToken