Open Closed

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


User avatar
0
prachi@urvin.finance created

[QUESTION DELETED]


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

    hi

    1. Please share a test access_token
    2. Please share the Debug logs of your API call.
    3. Please set a breakpoint to see the current claims of the API call.
    public class Program
    {
        public async static Task<int> Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Debug()
                .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
                .Enrich.FromLogContext()
                .WriteTo.Async(c => c.File("Logs/logs.txt"))
                .WriteTo.Async(c => c.Console())
                .CreateLogger();
    

    https://abp.io/community/articles/how-claim-type-works-in-asp-net-core-and-abp-framework-km5dw6g1

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Identity service logs

    1. Please share a test access_token

    2. Please set the log level as Debug and share full logs of Identity service logs

    public class Program
    {
        public async static Task<int> Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Debug()
                .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
                .Enrich.FromLogContext()
                .WriteTo.Async(c => c.File("Logs/logs.txt"))
                .WriteTo.Async(c => c.Console())
                .CreateLogger();```
    
    1. Please set a breakpoint in Identity service project to see the current claims of the api/identity-service/user-account/GetPAuthWithPermission call.
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The role type in claims is ClaimTypes.Role(http://schemas.microsoft.com/ws/2008/06/identity/claims/role)

    Please check the typeValue of AbpClaimTypes.Role

    var typeValue = AbpClaimTypes.Role typeValue should be http://schemas.microsoft.com/ws/2008/06/identity/claims/role

     {
     "Type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
     "Value": "admin"
     }
    

    If the typeValue is role, that's mean your claim type is incorrect.


    Please also check the Roles of CurrentUser, if the Roles is empty, it is also the problem of claim type.

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the content of IdentityService host module. It may be IdentityServiceModule or IdentityServiceHostModule

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    liming.ma@volosoft.com

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    No ideas why AbpClaimTypes.Role changed.

    We only change the AbpClaimTypes.Role to role in AbpOpenIddictAspNetCoreModule and some modules.


    Can you search the AbpClaimTypes.Role in your whole solution?

    Or can you share the full source code of your solution?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I can remote-check your app at https://www.worldtimebuddy.com/?qm=1&lid=1816670&h=1816670&date=2024-11-14&sln=10-17&hf=0

    Please send your time to liming.ma@volosoft.com

    I will share the zoom link.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://us05web.zoom.us/j/84770432055?pwd=u9f1aiz1EIE2beTZWXVLNpwOaWlz0j.1

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I will share zoom link at 7:00 AM (UTC+0)

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    maliming is inviting you to a scheduled Zoom meeting.

    Topic: maliming's Zoom Meeting Time: Nov 15, 2024 15:00 Beijing, Shanghai

    Join Zoom Meeting https://us05web.zoom.us/j/82434243267?pwd=utBSiIrsyBIXZbJDJnkfbwZ9MJBhZu.1

    Meeting ID: 824 3424 3267 Passcode: 7Npsyq

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    
    Autofac.Core.DependencyResolutionException: 
    An exception was thrown while activating 
    
    Volo.Abp.PermissionManagement.Identity.RolePermissionManagementProvider -> Volo.Abp.Identity.HttpClientUserRoleFinder.
    
    ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Volo.Abp.Identity.HttpClientUserRoleFinder' can be invoked with the available services and parameters:
    
    Cannot resolve parameter 'Volo.Abp.Identity.Integration.IIdentityUserIntegrationService userIntegrationService' 
    
    of constructor 'Void .ctor(Volo.Abp.Identity.IIdentityUserAppService, Volo.Abp.Identity.Integration.IIdentityUserIntegrationService)'.
    

    To use IIdentityUserIntegrationService, you have to depend on AbpIdentityApplicationModule

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you get the full Logs.txt file of your IdentityServiceHttpApiHostModule? then send it to liming.ma@volosoft.com

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Have you depended on AbpIdentityHttpApiClientModule in your administration-service?

    You shouldn't depend on AbpIdentityHttpApiClientModule.

    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
    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
    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
    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
    maliming created
    Support Team Fullstack Developer

    hi

    Please share full logs again

    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
    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
    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
    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
    maliming created
    Support Team Fullstack Developer

    What are generated classes in ClientProxies folder?

    Is there an IdentityUserIntegrationClientProxy file?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Have you set ExposeIntegrationServices to true?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The interfaces of IdentityUserIntegrationController is empty.

    Can you check this?

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 04, 2025, 16:11