Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Where is the TenantId resolved? #3133


User avatar
0
bilalhaidar created

Hi, I read the documentation and the order the different resolving contributors are checked for TenantId. Can you please guide me in the framework where in the code those resolvers are called and where the TenantId Claim is added to the list of claims?

Thanks


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can check both files. TenantResolver's code is called in ClaimsAbpSession.

    <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/MultiTenancy/TenantResolver.cs#L65">https://github.com/aspnetboilerplate/as ... ver.cs#L65</a> <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Runtime/Session/ClaimsAbpSession.cs#L65">https://github.com/aspnetboilerplate/as ... ion.cs#L65</a>

  • User Avatar
    0
    bilalhaidar created

    I was confused as I couldn't find an Ioc registration for IAbpSession. Now that I know the ClaimsAbpSession is the only implementation it makes since with conventional registration, IAbpSession got resolved, and first time IAbpSession.TenantId is called, it will resolve it, correct?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, actually each time when you access IAbpSession.TenantId it is resolved.

  • User Avatar
    0
    bilalhaidar created

    Thanks :).

    Also, I think it is being cached so that not to go through all the cycle again, according to documentation.