Open Closed

Invalid Token issue while confirming the email #6017


User avatar
0
hiteshsahu created

HI,

ABP Framework version: 7.0.1 UI type: Angular DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): yes Exception message and stack trace: Steps to reproduce the issue:"

I am having issue when i try to confirm my email address i am getting invalid token issue

i found that in the token + is converting to \u002B

  1. below token which send with email confirmation request CfDJ8LXriWteL1JAq37fwddNTQoU0gQtV4tOOS9oe7VVk1rmYUUSLYJNbXtSkoHM2vP2PMOekW1KvIzeZKtEM8XCK/lhcU2BP9kZqvK0ARjxElDB8I6Ue7cA0HCf3nHEZcLzn0sQDP9Sy9HnjRzU7HchLKPO+0MxPIF2T3jOPGoZxzVaCqDKm6SgxllbgSiJpeGur0vs42DR2wPPN5nXwEq/W6pf2wHAuJReGlkrn+eXO0gsxgDdTUf7rA8qnCJzGx1U6w==

2.below token is received at server
CfDJ8LXriWteL1JAq37fwddNTQp\u002Bh3s5u30kApOd8WHgsoBSXhjCTrhgXQeyx87JkAt6i9yZhDxpOWZMZBpUAeGgVfF/GJ4LvqzZFr0nGZUdQPKiBhnBNbg4LTeycK1FbAPWhKSOlYQUuaOQ/22Ptx\u002BilhUOh79p3HxnpGJS\u002B8yu1JzzcqauMKA7MRmy8DTaq1xIkYurx17kfjwuhkuTXVVdPDmcALV/Ou2lidMOCc9\u002BAjk0e72tHmHqAUw2VglRxh9eyw==

AuthserverLogs

[19:05:44 INF] Executed action Volo.Abp.Account.AccountController.ConfirmEmailAsync (Volo.Abp.Account.Pro.Public.HttpApi) in 2757.4976ms [19:05:44 INF] Executed endpoint 'Volo.Abp.Account.AccountController.ConfirmEmailAsync (Volo.Abp.Account.Pro.Public.HttpApi)' [19:05:44 DBG] Added 0 entity changes to the current audit log [19:05:44 INF] AUDIT LOG: [204: POST ] /api/account/confirm-email - UserName - UserId : AjazRathod - f8362771-14f3-97fc-4949-3a0b21877e05 - ClientIpAddress : ::1 - ExecutionDuration : 2758 - Actions:  - Volo.Abp.Account.AccountAppService.ConfirmEmailAsync (2752 ms.)  {"input":{"userId":"f8362771-14f3-97fc-4949-3a0b21877e05","token":"CfDJ8LXriWteL1JAq37fwddNTQp\u002Bh3s5u30kApOd8WHgsoBSXhjCTrhgXQeyx87JkAt6i9yZhDxpOWZMZBpUAeGgVfF/GJ4LvqzZFr0nGZUdQPKiBhnBNbg4LTeycK1FbAPWhKSOlYQUuaOQ/22Ptx\u002BilhUOh79p3HxnpGJS\u002B8yu1JzzcqauMKA7MRmy8DTaq1xIkYurx17kfjwuhkuTXVVdPDmcALV/Ou2lidMOCc9\u002BAjk0e72tHmHqAUw2VglRxh9eyw=="}  - Volo.Abp.Account.AccountController.ConfirmEmailAsync (2753 ms.)  {"input":{"userId":"f8362771-14f3-97fc-4949-3a0b21877e05","token":"CfDJ8LXriWteL1JAq37fwddNTQp\u002Bh3s5u30kApOd8WHgsoBSXhjCTrhgXQeyx87JkAt6i9yZhDxpOWZMZBpUAeGgVfF/GJ4LvqzZFr0nGZUdQPKiBhnBNbg4LTeycK1FbAPWhKSOlYQUuaOQ/22Ptx\u002BilhUOh79p3HxnpGJS\u002B8yu1JzzcqauMKA7MRmy8DTaq1xIkYurx17kfjwuhkuTXVVdPDmcALV/Ou2lidMOCc9\u002BAjk0e72tHmHqAUw2VglRxh9eyw=="}  [19:05:44 ERR] claim is empty or token is invalid. TrackingId:e34be745-9e8d-4f07-8495-0b9335edbf77_G25, SystemTracker:orderline.servicebus.windows.net:NxP_Local, Timestamp:2023-10-19T14:38:18 Status: 401 (Unauthorized)  Content: <Error><Code>401</Code><Detail>claim is empty or token is invalid. TrackingId:e34be745-9e8d-4f07-8495-0b9335edbf77_G25, SystemTracker:orderline.servicebus.windows.net:NxP_Local, Timestamp:2023-10-19T14:38:18</Detail></Error>  Headers: Transfer-Encoding: chunked ETag: 638102400516570000 Server: Microsoft-HTTPAPI/2.0 Strict-Transport-Security: REDACTED Date: Thu, 19 Oct 2023 14:38:17 GMT Content-Type: application/xml; charset=utf-8  System.UnauthorizedAccessException: claim is empty or token is invalid. TrackingId:e34be745-9e8d-4f07-8495-0b9335edbf77_G25, SystemTracker:orderline.servicebus.windows.net:NxP_Local, Timestamp:2023-10-19T14:38:18 Status: 401 (Unauthorized)  Content: <Error><Code>401</Code><Detail>claim is empty or token is invalid. TrackingId:e34be745-9e8d-4f07-8495-0b9335edbf77_G25, SystemTracker:orderline.servicebus.windows.net:NxP_Local, Timestamp:2023-10-19T14:38:18</Detail></Error>  Headers: Transfer-Encoding: chunked ETag: 638102400516570000 Server: Microsoft-HTTPAPI/2.0 Strict-Transport-Security: REDACTED Date: Thu, 19 Oct 2023 14:38:17 GMT Content-Type: application/xml; charset=utf-8   ---> Azure.RequestFailedException: claim is empty or token is invalid. TrackingId:e34be745-9e8d-4f07-8495-0b9335edbf77_G25, SystemTracker:orderline.servicebus.windows.net:NxP_Local, Timestamp:2023-10-19T14:38:18 Status: 401 (Unauthorized)  Content: <Error><Code>401</Code><Detail>claim is empty or token is invalid. TrackingId:e34be745-9e8d-4f07-8495-0b9335edbf77_G25, SystemTracker:orderline.servicebus.windows.net:NxP_Local, Timestamp:2023-10-19T14:38:18</Detail></Error>  Headers: Transfer-Encoding: chunked ETag: 638102400516570000 Server: Microsoft-HTTPAPI/2.0 Strict-Transport-Security: REDACTED Date: Thu, 19 Oct 2023 14:38:17 GMT Content-Type: application/xml; charset=utf-8   --- End of inner exception stack trace ---  at Azure.Messaging.ServiceBus.Administration.HttpRequestAndResponse.ThrowIfRequestFailedAsync(Request request, Response response)  at Azure.Messaging.ServiceBus.Administration.HttpRequestAndResponse.SendHttpRequestAsync(Request request, CancellationToken cancellationToken)  at Azure.Messaging.ServiceBus.Administration.HttpRequestAndResponse.GetEntityAsync(String entityPath, String query, Boolean enrich, CancellationToken cancellationToken)  at Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient.TopicExistsAsync(String name, CancellationToken cancellationToken)  at Volo.Abp.AzureServiceBus.ServiceBusAdministrationClientExtensions.SetupTopicAsync(ServiceBusAdministrationClient client, String topicName)  at Volo.Abp.AzureServiceBus.PublisherPool.GetAsync(String topicName, String connectionName)  at Volo.Abp.EventBus.Azure.AzureDistributedEventBus.PublishAsync(String eventName, Byte[] body, Nullable1 eventId)  at Volo.Abp.EventBus.Azure.AzureDistributedEventBus.PublishToEventBusAsync(Type eventType, Object eventData)  at Volo.Abp.EventBus.Distributed.DistributedEventBusBase.PublishAsync(Type eventType, Object eventData, Boolean onUnitOfWorkComplete, Boolean useOutbox)  at Volo.Abp.EventBus.UnitOfWorkEventPublisher.PublishDistributedEventsAsync(IEnumerable1 distributedEvents)  at Volo.Abp.Uow.UnitOfWork.CompleteAsync(CancellationToken cancellationToken)  at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)  at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location ---  at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) [19:05:44 INF] Request finished HTTP/2 POST https://localhost:44322/api/account/confirm-email application/json 324 - 500 - application/json 3076.0365ms

Kindly help me to resolve this issue

Thank you.


5 Answer(s)
Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38