Base solution for your next web application

Activities of "coforgetech"

Please find source code of inner service which ABP team ask for UnitOfWork.

Public class TWAppService: ITWAppService { private readonly ObjectPool<ApiDC> _objectPool; private readonly IConfigurationRoot _configuration; private readonly FFConfig _fFConfig; private readonly IDSRepository _dsRepository; private readonly ILogger _logger;

public TWAppService ( IAppConfigurationAccessor appConfigurationAccessor, IDSRepository dsRepository, ObjectPool<ApiDC> objectPool, ILogger logger) { _configuration = appConfigurationAccessor.Configuration; _fFConfig = new FFConfig(); _configuration.GetSection(FFConfig.FFConfig).Bind(_FFConfig); _dsRepository = dsRepository; _objectPool = objectPool; _logger = logger; }

public async Task<WKObject> GetViewWk() { var apiContext = _objectPool.Get(); var ds = _dsRepository.GetDataSource(DefaultSource.Ff.GetHashCode()); var ViewUrl = ds.BaseUrl + _FFConfig.ViewWiki; var data = await apiContext.GetData(ViewUrl, ds); var obj = JsonConvert.DeserializeObject<WKObject>(data); return obj; } }

Support team. Please suggest.

This issue is intermittent and is occurring on some pages. Below the code snippet from one of the page where issue is found.

[AbpAuthorize(AppPermissions.Services_CS_TW)]

public class TWAppService: DashboardAppServiceBase, ITWAppService
{
    private readonly IFFOrgRepository _ffOrgRepository;
    public TWAppService(IFFOrgRepository FFOrgRepository)
    {
        _ffOrgRepository = FFOrgRepository;
    }

    [HttpGet]
    public async Task&lt;WkObject&gt; GetViewWk()
    {
        return await _ffOrgRepository.GetViewWk();
    }

What is your product version? 10.3 What is your product type (Angular or MVC)? Angular What is product framework type (.net framework or .net core)? .Net Core Which theme are you using? Default What is ABP Framework version? 6.3

Hi team, We’re getting the below error when we’re visiting the pages and it occurs intermittently. We neither customize the authentication nor UnitOfWork or wrote any wrapper.

We are only using DI to get repository or services.

Error with Stack Trace:

ERROR 2022-01-14 12:49:34,865 [53 ] Mvc.Authorization.AbpAuthorizationFilter - System.ArgumentNullException: Value cannot be null. (Parameter 'unitOfWork') at Abp.EntityFrameworkCore.Uow.UnitOfWorkExtensions.GetDbContextAsync[TDbContext](IActiveUnitOfWork unitOfWork, Nullable1 multiTenancySide, String name) at Abp.EntityFrameworkCore.Uow.UnitOfWorkDbContextProvider1.GetDbContextAsync(Nullable1 multiTenancySide) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetContextAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetDbQueryTableAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetQueryableAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllIncludingAsync(Expression1[] propertySelectors) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.FirstOrDefaultAsync(TPrimaryKey id) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.Users.AbpUserManager2.<>c__DisplayClass88_0.<<GetUserPermissionCacheItemAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Abp.Runtime.Caching.TypedCacheWrapper2.<>c__DisplayClass18_0.<<GetAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Abp.Runtime.Caching.AbpCacheBase2.GetAsync(TKey key, Func2 factory) at Abp.Runtime.Caching.TypedCacheWrapper2.GetAsync(TKey key, Func2 factory) at Abp.Authorization.Users.AbpUserManager2.GetUserPermissionCacheItemAsync(Int64 userId) at Abp.Authorization.Users.AbpUserManager2.IsGrantedAsync(Int64 userId, Permission permission) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.Users.AbpUserManager2.IsGrantedAsync(Int64 userId, String permissionName) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.PermissionChecker2.IsGrantedAsync(Int64 userId, String permissionName) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.PermissionChecker2.IsGrantedAsync(String permissionName) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.PermissionCheckerExtensions.IsGrantedAsync(IPermissionChecker permissionChecker, Boolean requiresAll, String[] permissionNames) at Abp.Authorization.PermissionCheckerExtensions.AuthorizeAsync(IPermissionChecker permissionChecker, Boolean requireAll, String[] permissionNames) at Abp.Authorization.AuthorizationHelper.AuthorizeAsync(IEnumerable1 authorizeAttributes) at Abp.Authorization.AuthorizationHelper.CheckPermissionsAsync(MethodInfo methodInfo, Type type) at Abp.Authorization.AuthorizationHelper.AuthorizeAsync(MethodInfo methodInfo, Type type) at Abp.AspNetCore.Mvc.Authorization.AbpAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context) System.ArgumentNullException: Value cannot be null. (Parameter 'unitOfWork') at Abp.EntityFrameworkCore.Uow.UnitOfWorkExtensions.GetDbContextAsync[TDbContext](IActiveUnitOfWork unitOfWork, Nullable1 multiTenancySide, String name) at Abp.EntityFrameworkCore.Uow.UnitOfWorkDbContextProvider1.GetDbContextAsync(Nullable1 multiTenancySide) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetContextAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetDbQueryTableAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetQueryableAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllIncludingAsync(Expression1[] propertySelectors) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllAsync() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.FirstOrDefaultAsync(TPrimaryKey id) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.Users.AbpUserManager2.<>c__DisplayClass88_0.<<GetUserPermissionCacheItemAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Abp.Runtime.Caching.TypedCacheWrapper2.<>c__DisplayClass18_0.<<GetAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Abp.Runtime.Caching.AbpCacheBase2.GetAsync(TKey key, Func2 factory) at Abp.Runtime.Caching.TypedCacheWrapper2.GetAsync(TKey key, Func2 factory) at Abp.Authorization.Users.AbpUserManager2.GetUserPermissionCacheItemAsync(Int64 userId) at Abp.Authorization.Users.AbpUserManager2.IsGrantedAsync(Int64 userId, Permission permission) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.Users.AbpUserManager2.IsGrantedAsync(Int64 userId, String permissionName) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.PermissionChecker2.IsGrantedAsync(Int64 userId, String permissionName) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.PermissionChecker2.IsGrantedAsync(String permissionName) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Abp.Authorization.PermissionCheckerExtensions.IsGrantedAsync(IPermissionChecker permissionChecker, Boolean requiresAll, String[] permissionNames) at Abp.Authorization.PermissionCheckerExtensions.AuthorizeAsync(IPermissionChecker permissionChecker, Boolean requireAll, String[] permissionNames) at Abp.Authorization.AuthorizationHelper.AuthorizeAsync(IEnumerable1 authorizeAttributes) at Abp.Authorization.AuthorizationHelper.CheckPermissionsAsync(MethodInfo methodInfo, Type type) at Abp.Authorization.AuthorizationHelper.AuthorizeAsync(MethodInfo methodInfo, Type type) at Abp.AspNetCore.Mvc.Authorization.AbpAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)

Information:

What is your product version? 10.3 What is your product type (Angular or MVC)? Angular What is product framework type (.net framework or .net core)? ASP.Net Code Which theme are you using? Default

Question - How to integrate Siteminder authentication with ASP.NET ZERO for authentication whereas authorization should continue to be used from ASP.NET ZERO?

Currently, our application will be protected by siteminder for user authentication and all login and password related pages will be served from siteminder itself. Once user gets authenticated in the siteminder it will be redirected to our application. We will get the logged in user id from the siteminder in the header. With this context, how do we bypass the user authentication process implemented in ASP.NET Zero.

  1. Login and related pages should not be served from ASP.NET Zero. If we get the user id from siteminder header should assume that user is authenticated.

  2. There shouldn't be any user authentication takes place which as there will be no password stored in ASP.NET ZERO database. We will not have a password to pass in following method as we don’t want to authenticate. public async Task<AuthenticateResultModel> Authenticate([FromBody] AuthenticateModel model) { var loginResult = await GetLoginResultAsync( model.UserNameOrEmailAddress, model.Password, GetTenancyNameOrNull() ); }

  3. Once we get siteminder header with user id, rest of the process for authorizations and permissions should continue to work as it is with ASP.NET ZERO.

  4. ABP Login manager code is not available in code download.

Information:

  • What is your product version? 10.3
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? ASP.Net Code
  • Which theme are you using? Default

Question - There are two query regarding user entity as mention below:-

  1. How to update or delete existing property of user entity? E.g. We want to remove predefined field “Surname” from entity and not to be displayed in UI.
  2. Can we remove the check box option like in User Create/Edit page. (1) Set Random password (2) Change password on next login. (3) Send Activation Email (4) Active (5) Lockout enabled If we remove checkbox option features is it going to impact another module.
Showing 1 to 6 of 6 entries