Ends in:
7 DAYS
20 HRS
39 MIN
48 SEC
Ends in:
7 D
20 H
39 M
48 S
Open Closed

Permission-Based Authorization Failing after .Net upgrade 8.0 #8239


User avatar
0
prachi@urvin.finance created
  • ABP Framework version: v8.3.0* UI Type:Blazor Server
  • Database System: EF Core (PostgreSQL)
  • Exception message and full stack trace: 403 Forbidden
  • Steps to reproduce the issue: Log in as an super-admin. Not able to access any identity-related pages such as /identity/organization-units, /identity/roles, etc

I am encountering an application-wide issue where I'm unable to authorize any action method or view based on user permissions. However, role-based authorization is functioning as expected. Upon inspecting the token, it includes the user's role, but ABP is not retrieving permissions associated with that role.

I've also verified the database, and all necessary permissions are correctly seeded to this role. However, ABP still isn't retrieving or recognizing these permissions for authorization, even though role-based checks are working.

I suspect this issue may have arisen due to a recent project upgrade.


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

    Please share the full logs.txt file. liming.ma@volosoft.com You can delete the logs.txt file. Then start administration-service again, reproduce the problem and share the logs.txt. Thanks.

  • User Avatar
    0
    prachi@urvin.finance created

    I have e-mailed you the log file. You can have a look.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Your logs are not complete.

    Please share the logs that include app starting.

    I need the module load list logs.

  • User Avatar
    0
    prachi@urvin.finance created

    Sent!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi Your UrvinFinance.AdministrationService.AdministrationServiceHttpApiHostModule is depending on the Volo.Abp.Identity.AbpIdentityHttpApiClientModule.

    Please check the code of AdministrationServiceHttpApiHostModule class.

    {
       "Timestamp":"2024-11-15T13:34:11.5610752+00:00",
       "Level":"Information",
       "MessageTemplate":"  - Volo.Abp.Identity.AbpIdentityHttpApiClientModule",
       "RenderedMessage":"  - Volo.Abp.Identity.AbpIdentityHttpApiClientModule",
       "Properties":{
          "SourceContext":"Volo.Abp.AbpApplicationBase",
          "dd_span_id":"0",
          "dd_trace_id":"0",
          "dd_version":"",
          "dd_service":"UrvinFinance.AdministrationService.HttpApi.Host",
          "dd_env":"",
          "Application":"UrvinFinance.AdministrationService.HttpApi.Host"
       }
    }
    

    See the last line ---|Volo.Abp.Identity.AbpIdentityHttpApiClientModule:

    Starting UrvinFinance.AdministrationService.HttpApi.Host.
    Loaded ABP modules:
    UrvinFinance.AdministrationService.AdministrationServiceHttpApiHostModule
    ---|UrvinFinance.UrvinFinanceSharedLocalizationModule
    ---|---|Volo.Abp.Validation.AbpValidationModule
    ---|---|---|Volo.Abp.Validation.AbpValidationAbstractionsModule
    ---|---|---|Volo.Abp.Localization.AbpLocalizationModule
    ---|---|---|---|Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
    ---|---|---|---|Volo.Abp.Settings.AbpSettingsModule
    ---|---|---|---|---|Volo.Abp.Localization.AbpLocalizationAbstractionsModule
    ---|---|---|---|---|Volo.Abp.Security.AbpSecurityModule
    ---|---|---|---|---|Volo.Abp.Data.AbpDataModule
    ---|---|---|---|---|---|Volo.Abp.ObjectExtending.AbpObjectExtendingModule
    ---|---|---|---|---|---|Volo.Abp.Uow.AbpUnitOfWorkModule
    ---|---|---|---|---|---|Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule
    ---|---|---|---|Volo.Abp.Threading.AbpThreadingModule
    ---|Volo.Abp.Http.Client.IdentityModel.Web.AbpHttpClientIdentityModelWebModule
    ---|---|Volo.Abp.Http.Client.IdentityModel.AbpHttpClientIdentityModelModule
    ---|---|---|Volo.Abp.Http.Client.AbpHttpClientModule
    ---|---|---|---|Volo.Abp.Http.AbpHttpModule
    ---|---|---|---|---|Volo.Abp.Http.AbpHttpAbstractionsModule
    ---|---|---|---|---|Volo.Abp.Json.AbpJsonModule
    ---|---|---|---|---|---|Volo.Abp.Json.SystemTextJson.AbpJsonSystemTextJsonModule
    ---|---|---|---|---|---|---|Volo.Abp.Json.AbpJsonAbstractionsModule
    ---|---|---|---|---|---|---|Volo.Abp.Timing.AbpTimingModule
    ---|---|---|---|---|Volo.Abp.Minify.AbpMinifyModule
    ---|---|---|---|Volo.Abp.Castle.AbpCastleCoreModule
    ---|---|---|---|Volo.Abp.MultiTenancy.AbpMultiTenancyModule
    ---|---|---|---|---|Volo.Abp.MultiTenancy.AbpMultiTenancyAbstractionsModule
    ---|---|---|---|Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule
    ---|---|---|---|Volo.Abp.RemoteServices.AbpRemoteServicesModule
    ---|---|---|---|Volo.Abp.EventBus.AbpEventBusModule
    ---|---|---|---|---|Volo.Abp.Guids.AbpGuidsModule
    ---|---|---|---|---|Volo.Abp.BackgroundWorkers.AbpBackgroundWorkersModule
    ---|---|---|---|---|Volo.Abp.DistributedLocking.AbpDistributedLockingAbstractionsModule
    ---|---|---|Volo.Abp.IdentityModel.AbpIdentityModelModule
    ---|---|---|---|Volo.Abp.Caching.AbpCachingModule
    ---|---|---|---|---|Volo.Abp.Serialization.AbpSerializationModule
    ---|Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.AbpAspNetCoreMvcUiMultiTenancyModule
    ---|---|Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.AbpAspNetCoreMvcUiThemeSharedModule
    ---|---|---|Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.AbpAspNetCoreMvcUiBootstrapModule
    ---|---|---|---|Volo.Abp.AspNetCore.Mvc.UI.AbpAspNetCoreMvcUiModule
    ---|---|---|---|---|Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
    ---|---|---|---|---|---|Volo.Abp.AspNetCore.AbpAspNetCoreModule
    ---|---|---|---|---|---|---|Volo.Abp.Auditing.AbpAuditingModule
    ---|---|---|---|---|---|---|---|Volo.Abp.Auditing.AbpAuditingContractsModule
    ---|---|---|---|---|---|---|Volo.Abp.Authorization.AbpAuthorizationModule
    ---|---|---|---|---|---|---|---|Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule
    ---|---|---|---|---|---|Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
    ---|---|---|---|---|---|Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule
    ---|---|---|---|---|---|---|Volo.Abp.Application.AbpDddApplicationContractsModule
    ---|---|---|---|---|---|Volo.Abp.UI.Navigation.AbpUiNavigationModule
    ---|---|---|---|---|---|---|Volo.Abp.UI.AbpUiModule
    ---|---|---|---|---|---|Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule
    ---|---|---|---|---|---|Volo.Abp.Application.AbpDddApplicationModule
    ---|---|---|---|---|---|---|Volo.Abp.Domain.AbpDddDomainModule
    ---|---|---|---|---|---|---|---|Volo.Abp.ObjectMapping.AbpObjectMappingModule
    ---|---|---|---|---|---|---|---|Volo.Abp.Specifications.AbpSpecificationsModule
    ---|---|---|---|---|---|---|---|Volo.Abp.Domain.AbpDddDomainSharedModule
    ---|---|---|---|---|---|---|Volo.Abp.Features.AbpFeaturesModule
    ---|---|---|Volo.Abp.AspNetCore.Mvc.UI.Packages.AbpAspNetCoreMvcUiPackagesModule
    ---|---|---|---|Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingAbstractionsModule
    ---|---|---|Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpAspNetCoreMvcUiWidgetsModule
    ---|---|---|---|Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingModule
    ---|---|Volo.Abp.AspNetCore.MultiTenancy.AbpAspNetCoreMultiTenancyModule
    ---|Volo.Abp.Identity.AbpIdentityHttpApiClientModule
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You should not use any XXXHttpApiClientModule in your XXXServiceHttpApiHostModule

    https://abp.io/docs/latest/solution-templates/layered-web-application#httpapi-project

  • User Avatar
    0
    prachi@urvin.finance created

    Hi, I just removed all the XXXHttpApiClientModule dependencies from XXXServiceHttpApiHostModule. Now the application breaks. with Internal server error. Should I share the build logs with you?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share full logs again

    Thanks.

  • User Avatar
    0
    prachi@urvin.finance created

    I just shared the whole build logs for both administration-service and identity-service. Please have a look! Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have checked your logs. But there are no error/exception logs in it.

    Please share the logs that contains the Internal Server Error

    Thanks.

  • User Avatar
    0
    prachi@urvin.finance created

    Sent

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The error:

    An exception was thrown while activating UrvinFinance.IdentityService.User.UserController -> 
    UrvinFinance.IdentityService.UserProfileSettings.UserProfileAppService.
    
    Cannot resolve parameter 'UrvinFinance.PaymentService.Subscriptions.ISubscriptionAppService subscriptionAppService' 
    

    You should depend on the ISubscriptionAppService implement module.

    eg XXXApplicationModule

  • User Avatar
    0
    prachi@urvin.finance created

    I removed XXXHttpApiClientModule dependencies and added XXXApplicationModule dependencies, but now I am getting the below error while I build the identity-service

    {"Timestamp":"2024-11-18T11:51:36.7775236+00:00","Level":"Information","MessageTemplate":"Starting UrvinFinance.IdentityService.HttpApi.Host.","RenderedMessage":"Starting UrvinFinance.IdentityService.HttpApi.Host.","Properties":{"dd_span_id":"0","dd_trace_id":"0","dd_version":"","dd_service":"UrvinFinance.IdentityService.HttpApi.Host","dd_env":"","Application":"UrvinFinance.IdentityService.HttpApi.Host"}} {"Timestamp":"2024-11-18T11:51:37.8679784+00:00","Level":"Fatal","MessageTemplate":"UrvinFinance.IdentityService.HttpApi.Host terminated unexpectedly!","RenderedMessage":"UrvinFinance.IdentityService.HttpApi.Host terminated unexpectedly!","Exception":"Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module UrvinFinance.ImageService.ImageServiceApplicationModule, UrvinFinance.ImageService.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.\n ---> System.TypeLoadException: Method 'Handle' in type 'UrvinFinance.ImageService.Behaviour.ValidationBehavior2' from assembly 'UrvinFinance.ImageService.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.\n at UrvinFinance.ImageService.ImageServiceApplicationModule.ConfigureServices(ServiceConfigurationContext context)\n at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context)\n at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()\n --- End of inner exception stack trace ---\n at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()\n at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction)\n at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction)\n at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action1 optionsAction)\n at UrvinFinance.IdentityService.Program.Main(String[] args) in C:\Step2gen\urvinfinance\services\identity\src\UrvinFinance.IdentityService.HttpApi.Host\Program.cs:line 80","Properties":{"dd_span_id":"0","dd_trace_id":"0","dd_version":"","dd_service":"UrvinFinance.IdentityService.HttpApi.Host","dd_env":"","Application":"UrvinFinance.IdentityService.HttpApi.Host"}}

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The error is:

    System.TypeLoadException: 
    
    Method 'Handle' in type 'UrvinFinance.ImageService.Behaviour.ValidationBehavior2'
     from assembly 'UrvinFinance.ImageService.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
      does not have an implementation.
    
    C:\Step2gen\urvinfinance\services\identity\src\UrvinFinance.IdentityService.HttpApi.Host\Program.cs:line 80
    

    Please check your UrvinFinance.ImageService.Application project.

    You can also try to run abp clean command and build & run again.

    The error is not about abp framework.

    Thanks.

  • User Avatar
    0
    prachi@urvin.finance created

    Hi,

    The highlighted service (IIdentityUserIntegrationService) in the image is causing an error. Upon investigating, I discovered that the proxy for this service is missing. However, I am unable to generate the proxy. When attempting to do so, ABP creates a new json file with the name abp-generate-proxy.json file. Please assist.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Try to pass the -m to specify the module name.

    abp generate-proxy -t csharp -m identity --url http://localhost:44388/

    Remember to set ExposeIntegrationServices to true.

    Configure<AbpAspNetCoreMvcOptions>(options =>
    {
        options.ExposeIntegrationServices = true;
    });
    

    ? That service is not exposed by default, unless you explicitly set ExposeIntegrationServices options (see the Exposing Integration Services section).

    https://docs.abp.io/en/abp/latest/Integration-Services

  • User Avatar
    0
    prachi@urvin.finance created

    Hi, I ran the following command and the identity-generate-proxy.json had the information about the controller, but not about the services.

    abp generate-proxy -t csharp -m identity --url http://localhost:44388/ --without-contracts

    Please guide

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    What are generated classes in ClientProxies folder?

    Is there an IdentityUserIntegrationClientProxy file?

  • User Avatar
    0
    prachi@urvin.finance created

    No

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Have you set ExposeIntegrationServices to true?

  • User Avatar
    0
    prachi@urvin.finance created

    yes

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The interfaces of IdentityUserIntegrationController is empty.

    Can you check this?

  • User Avatar
    0
    prachi@urvin.finance created

    This interfaces array is empty

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Join and share screen

    https://us05web.zoom.us/j/87647575094?pwd=l38JLZ8wmFYZV6MGavjY9nWp3jrm0a.1

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Resovled

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06