Base solution for your next web application

Activities of "PhilWynn"

Hi,

I have modified my code as follows:

public IEnumerable<IdpConfiguration> GetAllActiveIdps()
        {
            using (UnitOfWorkManager.Begin(new UnitOfWorkOptions {IsTransactional = false}))
            {
                UnitOfWorkManager.Current.SetTenantId(null);

                return IdpConfigurations.AsNoTracking().Where(idp => idp.IsActive).ToList();
            }
        }

However I am still getting the following warnings (3 warnings everytime the method executes):

System.Web.HttpException (0x80004005): Request is not available in this context at System.Web.HttpContext.get_Request() at Abp.Web.MultiTenancy.DomainTenantResolveContributor.ResolveTenantId() in D:\Github\aspnetboilerplate\src\Abp.Web\Web\MultiTenancy\DomainTenantResolveContributor.cs:line 34 at Abp.MultiTenancy.TenantResolver.GetTenantIdFromContributors() in D:\Github\aspnetboilerplate\src\Abp\MultiTenancy\TenantResolver.cs:line 75

Note that I am running ABP v4.5

Hi,

Sorry, but this does not answer my question.

Because I am querying in module code, there is no UOW currently running, hence the need for me to call:

using (UnitOfWorkManager.Begin(new UnitOfWorkOptions {IsTransactional = false})){
..
}

The query is on the Host data, so no switching to a tenancy is required.

My questions are:

Is it acceptable to code in this way (i.e. querying from the module code)? How can I rid myself of the warning I am getting (the warning appears 3 times when the GetAllIdps method runs)

Thank you

Hi @blewis,

I am pretty stuck on this. I have no idea if you are receiving this notification, but if so I would be extremely grateful for some help.

Many thanks Phil

Hi @blewis,

I am currently about to embark on a similar task using Sustainsys.Saml2 (formerly Kentor).

Any code you can share would be very gratefully received.

Many thanks Phil

Answer

HI,

Unfortunately, the bug is intermitent, and I have been unable to reproduce it at will. I have improved logging in this area, so will have more to go on if and when it happens again.

Please could I request that we keep this ticket open for the time being so that I can get back to you if I have any more information.

Many thanks.

Answer

Hi,

Yes, I am obviously aware that this is the purpose of Linked Users and Impersonation.

The problem we had is that the system displayed tenancy/user information in the header label that was not related to the tenancy/user that was linke to/impersonated. Although, the data displayed was for the correct tenancy.

Also worth mentioning, the correct user/tenancy label was displayed after a page refresh.

I have added some additional logging here to help diagnose the problem. So far, it has happened twice.

Regards

Answer

Hi,

The discussion in the linked issue referres to Aspnet Core. I am using Aspnet MVC. Is there any guidance for this, or can the solution discussed be tailored for MVC?

Regards

Thank you. That worked.

Thank you for the prompt response. I will give this some more thought.

Hi,

Apologies, but I will need a little mor guidance. The code written for the Core version of the controller differs too much from the MVC version.

Please could I request some sample code to give me guidance as to how I can modifiy the Authenticate method.

Many thanks

Showing 11 to 20 of 75 entries