Open Closed

After migrating to abp 8.0 version multi tenancy does not work #7605


User avatar
0
smansuri created
  • ABP Framework version: v8.0.X
  • UI Type: Angular / MVC
  • Database System: EF Core (MySQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Auth Server Separated
  • Exception message and full stack trace: Issuer validation failed. Issuer: 'https://localhost:44322/'. Did not match: validationParameters.ValidIssuer: 'null' or validationParameters.ValidIssuers: 'https://{0}.localhost:44322/'.
  • Steps to reproduce the issue: migrate from abp version 7.3.2 to 8.0 and add multi tenancy changes as per url : https://abp.io/docs/latest/framework/architecture/multi-tenancy and try to login

after navigating from angular app to login page getting below error in logs :Issuer validation failed. Issuer: 'https://localhost:44322/'. Did not match: validationParameters.ValidIssuer: 'null' or validationParameters.ValidIssuers: 'https://{0}.localhost:44322/'.

after directly opening auth server url and try to log in getting error : The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessAuthenticationContext was marked as rejected by OpenIddict.Validation.OpenIddictValidationHandlers+ValidateRequiredTokens.

please find the logs, module and appsettings files in below shared folder. https://drive.google.com/drive/folders/148gFlQJA1JnkC3k4Dd0aHV5WQLTIsF-o?usp=sharing


19 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    you can try

    options.TokenValidationParameters.ValidIssuers = new[]
    {
       configuration["AuthServer:Authority"],
       configuration["AuthServer:ValidIssuers"] //the port may different
    };
    
  • User Avatar
    0
    smansuri created

    you can try

    options.TokenValidationParameters.ValidIssuers = new[] 
    { 
       configuration["AuthServer:Authority"], 
       configuration["AuthServer:ValidIssuers"] //the port may different 
    }; 
    

    Still getting the same error even after adding the above fix.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Sorry,

    options.TokenValidationParameters.ValidIssuers = new[] 
    { 
       configuration["AuthServer:Authority"] + "/", 
       configuration["AuthServer:ValidIssuers"] //the port may different 
    }; 
    
  • User Avatar
    0
    smansuri created

    Sorry,

    options.TokenValidationParameters.ValidIssuers = new[]  
    {  
       configuration["AuthServer:Authority"] + "/",  
       configuration["AuthServer:ValidIssuers"] //the port may different  
    };  
    

    still getting the same error

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Please share the latest log thanks.

  • User Avatar
    0
    smansuri created

    Above issue is resovled now but after migrating Saas service getting below error. 2024-08-01 15:50:30.645 +05:30 [INF] Request starting HTTP/2 GET https://localhost:44381/api/saas/editions/plan-lookup - null null 2024-08-01 15:50:30.750 +05:30 [INF] Request starting HTTP/2 GET https://localhost:44381/api/saas/editions?skipCount=0&maxResultCount=10 - null null 2024-08-01 15:50:31.084 +05:30 [INF] CORS policy execution successful. 2024-08-01 15:50:31.086 +05:30 [INF] CORS policy execution successful. 2024-08-01 15:50:31.577 +05:30 [INF] Executing endpoint 'Volo.Saas.Host.EditionController.GetListAsync (Volo.Saas.Host.HttpApi)' 2024-08-01 15:50:31.577 +05:30 [INF] Executing endpoint 'Volo.Saas.Host.EditionController.GetPlanLookupAsync (Volo.Saas.Host.HttpApi)' 2024-08-01 15:50:31.613 +05:30 [INF] Route matched with {controller = "Edition", area = "saas", action = "GetPlanLookup"}. Executing controller action with signature System.Threading.Tasks.Task1[System.Collections.Generic.List1[Volo.Payment.Plans.PlanDto]] GetPlanLookupAsync() on controller Volo.Saas.Host.EditionController (Volo.Saas.Host.HttpApi). 2024-08-01 15:50:31.627 +05:30 [INF] Route matched with {controller = "Edition", area = "saas", action = "GetList"}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.Application.Dtos.PagedResultDto1[Volo.Saas.Host.Dtos.EditionDto]] GetListAsync(Volo.Saas.Host.Dtos.GetEditionsInput) on controller Volo.Saas.Host.EditionController (Volo.Saas.Host.HttpApi). 2024-08-01 15:50:31.884 +05:30 [DBG] Added 0 entity changes to the current audit log 2024-08-01 15:50:31.900 +05:30 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": { "ActivatorChain": "Volo.Saas.Host.EditionController" }, "validationErrors": null }

    2024-08-01 15:50:31.900 +05:30 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": { "ActivatorChain": "Volo.Saas.Host.EditionController" }, "validationErrors": null }

    2024-08-01 15:50:31.901 +05:30 [ERR] An exception was thrown while activating Volo.Saas.Host.EditionController. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Saas.Host.EditionController. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Volo.Saas.Host.EditionController' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Saas.Host.IEditionAppService service' of constructor 'Void .ctor(Volo.Saas.Host.IEditionAppService)'.

    See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.<UseSingleConstructorActivation>b__0(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Builder.RegistrationBuilder3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.DelegateMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Builder.RegistrationBuilder3.<>c__DisplayClass39_0.<OnActivated>b__0(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Middleware.CoreEventMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) --- End of inner exception stack trace --- at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext context) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext context) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.

    See https://autofac.rtfd.io/help/no-constructors-bindable for more info. at Autofac.Core.Activators.Reflection.ReflectionActivator.<>c__DisplayClass14_0.

    2024-08-01 15:50:31.904 +05:30 [ERR] ---------- Exception Data ---------- ActivatorChain = Volo.Saas.Host.EditionController

    2024-08-01 15:50:31.957 +05:30 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. 2024-08-01 15:50:31.958 +05:30 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. 2024-08-01 15:50:31.972 +05:30 [INF] Executed action Volo.Saas.Host.EditionController.GetListAsync (Volo.Saas.Host.HttpApi) in 340.3451ms 2024-08-01 15:50:31.972 +05:30 [INF] Executed endpoint 'Volo.Saas.Host.EditionController.GetListAsync (Volo.Saas.Host.HttpApi)' 2024-08-01 15:50:31.972 +05:30 [INF] Executed action Volo.Saas.Host.EditionController.GetPlanLookupAsync (Volo.Saas.Host.HttpApi) in 353.2898ms 2024-08-01 15:50:31.972 +05:30 [INF] Executed endpoint 'Volo.Saas.Host.EditionController.GetPlanLookupAsync (Volo.Saas.Host.HttpApi)' 2024-08-01 15:50:31.972 +05:30 [DBG] Added 0 entity changes to the current audit log 2024-08-01 15:50:31.992 +05:30 [INF] Request finished HTTP/2 GET https://localhost:44381/api/saas/editions?skipCount=0&maxResultCount=10 - 500 null application/json; charset=utf-8 1241.6651ms 2024-08-01 15:50:31.992 +05:30 [INF] Request finished HTTP/2 GET https://localhost:44381/api/saas/editions/plan-lookup - 500 null

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    An exception was thrown while activating Volo.Saas.Host.EditionController. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Saas.Host.EditionController. ---> Autofac.Core.DependencyResolutionException: None of the constructors found on type 'Volo.Saas.Host.EditionController' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Saas.Host.IEditionAppService service' of constructor 'Void .ctor(Volo.Saas.Host.IEditionAppService)'.

    Seems like module dependencies are incorrect, check your solution

    [DependsOn(
         ......
         typeof(SaasHostApplicationModule),
         .....
        )]
    public class YourApplicationModule : AbpModule
    
     [DependsOn(
        .....
        typeof(SaasHostHttpApiModule),
        .....
        )]
    public class YourHttpApiModule : AbpModule
    
    [DependsOn(
        ....
        typeof(YourHttpApiModule),
        ....
        typeof(YourApplicationModule),
        ....
        )]
    public class YourHttpApiHostModule : AbpModule
    
  • User Avatar
    0
    smansuri created

    thanks it worked. Now while selecting a permission menu for a user getting below 404 error. 2024-08-02 18:16:13.368 +05:30 [INF] Sending HTTP request GET https://localhost:44388/integration-api/identity/users/3a104ca8-2d0b-0494-3653-5e7e48633bd5/role-names?api-version=1.0 2024-08-02 18:16:13.380 +05:30 [INF] Received HTTP response headers after 12.2339ms - 404 2024-08-02 18:16:13.380 +05:30 [INF] End processing HTTP request after 12.4049ms - 404 2024-08-02 18:16:13.391 +05:30 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": "NotFound", "message": "Not Found", "details": null, "data": null, "validationErrors": null } Volo.Abp.Http.Client.AbpRemoteCallException: Not Found at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Identity.Integration.IdentityUserIntegrationClientProxy.GetRoleNamesAsync(Guid id) at Volo.Abp.Identity.HttpClientUserRoleFinder.GetRoleNamesAsync(Guid userId) at Volo.Abp.PermissionManagement.Identity.RolePermissionManagementProvider.CheckAsync(String[] names, String providerName, String providerKey) at Volo.Abp.PermissionManagement.PermissionManager.GetInternalAsync(PermissionDefinition[] permissions, String providerName, String providerKey) at Volo.Abp.PermissionManagement.PermissionManager.GetAsync(String[] permissionNames, String providerName, String providerKey) 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.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, AbpAuditingOptions options, 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.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.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at lambda_method2837(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

  • User Avatar
    0
    DominaTang created

    If my memory is correct while I compare ABP 8 generated template against 7, these two tables are drop from ABP 8 Volo.Payment.Plans.GatewayPlan Volo.Payment.Plans.Plan

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    i think this is a new question, could you please create a new ticket, thanks.

  • User Avatar
    0
    smansuri created

    sorry to say but all these issues are part of migration from 7.3 to 8.0 so why do i have to create different tickets for issues of one migration.

  • User Avatar
    0
    smansuri created

    event after uninstalling payments module we are seeing the same error. moreover , we observer that the same url with different params working.

    From Users menu: https://localhost:44325/api/permission-management/permissions?providerName=U&providerKey=3a119289-b1c3-4980-f238-793a348dd78d Giving 404 error users menu internal calling identity service url : https://localhost:44388/integration-api/identity/users/3a104ca8-2d0b-0494-3653-5e7e48633bd5/role-names?api-version=1.0 which is failing. Also noticed that the url in the browser is just /roles and not /role-names.

    From Roles: https://localhost:44325/api/permission-management/permissions?providerName=R&providerKey=admin working fine.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    your original question is about Issuer validation failed. Issuer: 'https://localhost:44322/'. Did not match: validationParameters.ValidIssuer: 'null' or validationParameters.ValidIssuers: 'https://{0}.localhost:44322/'.

  • User Avatar
    0
    smansuri created

    still the migration process is a single step no multiple. so you should answer all related questions in one single thread.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi smansuri

    What's the current error?

  • User Avatar
    0
    smansuri created

    we observer that we are getting 404 error on the url https://localhost:44325/api/permission-management/permissions?providerName=U&providerKey=3a119289-b1c3-4980-f238-793a348dd78d while for roles same url : https://localhost:44325/api/permission-management/permissions?providerName=R&providerKey=admin is working.

    From Users menu if click on permission url: https://localhost:44325/api/permission-management/permissions?providerName=U&providerKey=3a119289-b1c3-4980-f238-793a348dd78d Giving 404 error

    internal calling identity service url : https://localhost:44388/integration-api/identity/users/3a104ca8-2d0b-0494-3653-5e7e48633bd5/role-names?api-version=1.0 which is failing. Also noticed that the url in the browser is just /roles and not /role-names.

    From Roles menu click permission: https://localhost:44325/api/permission-management/permissions?providerName=R&providerKey=admin working fine.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, Please share the logs for the 404 error(44325 and 44388)

  • User Avatar
    0
    smansuri created

    please find the logs at : https://drive.google.com/drive/folders/148gFlQJA1JnkC3k4Dd0aHV5WQLTIsF-o?usp=sharing

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Do you have the code below in your project(IdentityService.HttpApi.Host)?

    Configure<AbpAspNetCoreMvcOptions>(options =>
    {
        options.ExposeIntegrationServices = true;
    });
    
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35