Skip to content

Error on Login with Postman #1

Description

@luisggarcia

error when try to login with Postman
error

"System.IdentityModel.Tokens.Jwt.JwtPayload.AddFirstPriorityClaims(String issuer, String audience, Nullable1 notBefore, Nullable1 expires, Nullable`1 issuedAt)"

System.ArgumentException: IDX12401: Expires: '18/09/2023 10:00:52 a. m.' must be after NotBefore: '18/09/2023 03:45:52 p. m.'.
at System.IdentityModel.Tokens.Jwt.JwtPayload.AddFirstPriorityClaims(String issuer, String audience, Nullable1 notBefore, Nullable1 expires, Nullable1 issuedAt) at System.IdentityModel.Tokens.Jwt.JwtPayload..ctor(String issuer, String audience, IEnumerable1 claims, IDictionary2 claimsCollection, Nullable1 notBefore, Nullable1 expires, Nullable1 issuedAt)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.CreateJwtSecurityTokenPrivate(String issuer, String audience, ClaimsIdentity subject, Nullable1 notBefore, Nullable1 expires, Nullable1 issuedAt, SigningCredentials signingCredentials, EncryptingCredentials encryptingCredentials, IDictionary2 claimCollection, String tokenType, IDictionary2 additionalHeaderClaims, IDictionary2 additionalInnerHeaderClaims)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.CreateToken(SecurityTokenDescriptor tokenDescriptor)
at TasksApi.Helpers.TokenHelper.GenerateAccessToken(Int32 userId) in C:\Users\8001138\Source\Repos\TasksApi\TasksApi\Helpers\TokenHelper.cs:line 33
at TasksApi.Services.TokenService.GenerateTokensAsync(Int32 userId) in C:\Users\8001138\Source\Repos\TasksApi\TasksApi\Services\TokenService.cs:line 21
at TasksApi.Services.UserService.LoginAsync(LoginRequest loginRequest) in C:\Users\8001138\Source\Repos\TasksApi\TasksApi\Services\UserService.cs:line 69
at TasksApi.Controllers.UsersController.Login(LoginRequest loginRequest) in C:\Users\8001138\Source\Repos\TasksApi\TasksApi\Controllers\UsersController.cs:line 35
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.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.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

HEADERS

Accept: /
Connection: keep-alive
Host: localhost:7217
User-Agent: PostmanRuntime/7.33.0
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 71
Postman-Token: 58ea1a67-6e38-4d7b-85de-a916f11bc305

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions