Activities of "sefa"

  • ABP Framework version: v8.2.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:

CRM Service

[08:34:28 INF] Sending HTTP request GET http://192.168.1.105:44516/api/setting-service/product-group/by-merchant-id/c8909caa-775d-f757-aadb-3a1559e60015?api-version=1.0 [08:34:28 INF] Received HTTP response headers after 12.7151ms - 401 [08:34:28 INF] End processing HTTP request after 12.8701ms - 401 [08:34:28 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": "Unauthorized", "message": "Unauthorized", "details": null, "data": null, "validationErrors": null }

[08:34:28 ERR] Unauthorized

Setting Service

[08:34:28 INF] Bearer was not authenticated. Failure message: IDX10223: Lifetime validation failed. The token is expired. ValidTo (UTC): '11/15/2024 8:28:35 AM', Current time (UTC): '11/15/2024 8:34:28 AM'. [08:34:28 INF] Executing endpoint 'MyProject.SettingService.ProductGroups.ProductGroupController.GetListByMerchantIdAsync (MyProject.SettingService.HttpApi)' [08:34:28 INF] Route matched with {area = "SettingService", action = "GetListByMerchantId", controller = "ProductGroup"}. Executing controller action with signature System.Threading.Tasks.Task1[System.Collections.Generic.List1[MyProject.SettingService.ProductGroups.ProductGroupDto]] GetListByMerchantIdAsync(System.Guid) on controller MyProject.SettingService.ProductGroups.ProductGroupController (MyProject.SettingService.HttpApi). [08:34:28 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy [08:34:28 INF] Authorization failed. These requirements were not met: PermissionRequirement: SettingService.ProductGroups [08:34:28 WRN] ---------- RemoteServiceErrorInfo ---------- { "code": "Volo.Authorization:010001", "message": "Authorization failed! Given policy has not granted.", "details": null, "data": {}, "validationErrors": null }

[08:34:28 WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.

  • Steps to reproduce the issue:
  1. I am sending a request to the merchant/detail endpoint.
  2. Merchant service is sending a request (http) to SettingService to get the details.
  3. The request sent at 8:32:00 is successful.
  4. The request sent at 8:34:00 gives a 401.
  5. When I look at the logs, it says that the token expired at 08:28:00. So how did the request sent at 8:32:00 return 200?

When I clear the redis cache, the problem is temporarily solved. A few minutes later, I encounter the same scenario again.

Note: I only have this problem with communication between microservices.

Thanks. I solved it using integration service.

hi maliming

Thank you for your quick response. I created IntegrationAppService in IdentityService. But I cannot access this service I created from other microservices.

Identity.Contracts

Identity.Application

Microservice application.csproj

Microservice application.cs

I know I can't access it because I can't create proxies in the identity service. But I still wanted to explain. What should I do now?

  • ABP Framework version: v8.2.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: [08:34:23 INF] Executing endpoint 'Volo.Abp.Identity.IdentityUserController.CreateAsync (Volo.Abp.Identity.Pro.HttpApi)' [08:34:23 INF] Route matched with {area = "identity", controller = "User", action = "Create"}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.Identity.IdentityUserDto] CreateAsync(Volo.Abp.Identity.IdentityUserCreateDto) on controller Volo.Abp.Identity.IdentityUserController (Volo.Abp.Identity.Pro.HttpApi). [08:34:23 INF] Authorization failed. These requirements were not met: PermissionRequirement: AbpIdentity.Users.Create PermissionRequirement: AbpIdentity.Users [08:34:23 WRN] ---------- RemoteServiceErrorInfo ---------- { "code": "Volo.Authorization:010001", "message": "Authorization failed! Given policy has not granted.", "details": null, "data": {}, "validationErrors": null }

[08:34:23 WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. at Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.CheckAsync(IAuthorizationService authorizationService, AuthorizationPolicy policy) at Volo.Abp.Authorization.MethodInvocationAuthorizationService.CheckAsync(MethodInvocationAuthorizationContext context) at Volo.Abp.Authorization.AuthorizationInterceptor.AuthorizeAsync(IAbpMethodInvocation invocation) 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.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at lambda_method1803(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.

  • Steps to reproduce the issue:
  • I am creating a new microservice (A). This microservice communicates with other microservices.
  • I want to create a new user from microservice A.
  • According to the "Synchronous Communication Between Microservices in Abp" document, I add IdentityService to microservice A.
  • When I try to create a new user by calling IdentityService via microservice A, I get a 401 error.
Showing 1 to 4 of 4 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11