@PostMapping(/authenticate) request is not working, stopped by 403 Forbidden

76 Views Asked by At

Actual Behavior: 403 Forbidden

2023-06-16T15:17:10.318+03:00 DEBUG 16168 --- [nio-8081-exec-1] o.s.security.web.FilterChainProxy        : Securing POST /error
2023-06-16T15:17:10.322+03:00 DEBUG 16168 --- [nio-8081-exec-1] o.s.s.w.a.AnonymousAuthenticationFilter  : Set SecurityContextHolder to anonymous SecurityContext
2023-06-16T15:17:10.324+03:00 DEBUG 16168 --- [nio-8081-exec-1] o.s.s.w.a.Http403ForbiddenEntryPoint     : Pre-authenticated entry point called. Rejecting access

Expected behavior: 200 OK

{ "token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJpLm5pa29sb3ZhMjNAYWNzYmcub3JnIiwiaWF0IjoxNjg2OTE2Nzg2LCJleHAiOjE2ODY5MTgyMjZ9.Qbd-3hELj6cOcyMU_jXSo8m4HsZbC6T7jSGbt_w-VRk" // example }

There is no specific error message, which makes it tough to debug. I also found that if I try an invalid URI, it will respond the same way as with (/jwt/auth), which actually exists. So it doesn't even reach the URI, but something's probably not working in the JwtFilter. Please help.

The database:

members: enter image description here

members_seq: enter image description here

Here is the repository: https://github.com/PlamenWorkplace/PlamenSpringBoot3Project.git

0

There are 0 best solutions below