Open Closed

nolayers solution error viewing identity server client permission #2917


User avatar
0
rcalv002 created

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, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.2.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • [21:59:05 INF] Request starting HTTP/2 GET https://localhost:44376/AbpPermissionManagement/PermissionManagementModal?providerName=C&providerKey=Shipwell_App&providerKeyDisplayName=Shipwell_App - - [21:59:05 INF] Executing endpoint '/AbpPermissionManagement/PermissionManagementModal' [21:59:05 INF] Route matched with {page = "/AbpPermissionManagement/PermissionManagementModal", area = "", action = "", controller = ""}. Executing page /AbpPermissionManagement/PermissionManagementModal [21:59:05 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy [21:59:05 INF] Executing handler method Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement.PermissionManagementModal.OnGetAsync - ModelState is Valid [21:59:05 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null } [21:59:05 ERR] No policy defined to get/set permissions for the provider 'C'. Use PermissionManagementOptions to map the policy. Volo.Abp.AbpException: No policy defined to get/set permissions for the provider 'C'. Use PermissionManagementOptions to map the policy. at Volo.Abp.PermissionManagement.PermissionAppService.CheckProviderPolicy(String providerName) at Volo.Abp.PermissionManagement.PermissionAppService.GetAsync(String providerName, String providerKey) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement.PermissionManagementModal.OnGetAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() [21:59:05 INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. [21:59:05 INF] Executed page /AbpPermissionManagement/PermissionManagementModal in 128.6614ms [21:59:05 INF] Executed endpoint '/AbpPermissionManagement/PermissionManagementModal'
  • Steps to reproduce the issue:"
  • Create a new nolayers solution and run dbmigrator
  • Create an IdentityServer client, try to view the permissions for the client, the above error occurs and nothing happens on the frontend.

7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Try to depens AbpPermissionManagementDomainIdentityServerModule

  • User Avatar
    0
    rcalv002 created

    Yes this worked, should this be part of the standard template ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    We fixed this, Other templates won't be affected.

  • User Avatar
    0
    rcalv002 created

    Thanks. In the snippet below, the template also seems to be missing the automapper module registration

    private void ConfigureAutoMapper(IServiceCollection services)
        {
            services.AddAutoMapperObjectMapper<MyModule>(); // This line seems to be missing too
            Configure<AbpAutoMapperOptions>(options =>
            {
                /* Uncomment `validate: true` if you want to enable the Configuration Validation feature.
                 * See AutoMapper's documentation to learn what it is:
                 * https://docs.automapper.org/en/stable/Configuration-validation.html
                 */
                options.AddMaps<MyModule>(/* validate: true */);
            });
        }
    

    Can you confirm?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I will update the templates Thanks.

  • User Avatar
    0
    rcalv002 created

    maliming, I also see other problems with the template. I've compared against standard app template.

    In standard app template:

    • Generate fresh template with abp new prodrelease -t app
    • run dbmigrator
    • Set ASPNETCORE_ENVIRONMENT to Production
    • Add an entry to en.json localization
    • Login to frontend, localization content is fine.
    • Validate by calling /api/abp/application-configuration you can see the new entry under prodrelease node of localization

    In nolayer

    • Generate fresh template with abp new prodrelease -t app
    • run dbmigrator
    • Set ASPNETCORE_ENVIRONMENT to Production
    • Add an entry to en.json localization
    • Login to frontend, localization content from json in local project is not fine, you see the Welcome_Title instead of the localized text
    • Validate by calling /api/abp/application-configuration you can not see the new nor any project specific entry under prodrelease node of localization . This issue also seems to affect other embedded content, like for example if you create a new settings component to have custom settings, this content doesnt get loaded in Production build unless you copy the Components folder to the bin folder where the production build is generated.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>

    https://github.com/abpframework/abp/pull/12401

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19