ali-bouali / spring-boot-3-jwt-security

Sample project on how to implement JWT security based using Spring boot 3 and Spring security 6

Home Page:https://aliboucoding.com/p/securing-your-spring-boot-3-0-applications-with-json-web-tokens-jwt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

403 forbidden error while Authentication

HARSHA95336 opened this issue · comments

Same here, cant figure out what the issue is

I had the same issue, my error was that I had duplicates in my users table.

I had the same issue. The reason might be hat in SecurityConfiguration method hasRole() expects role to have ROLE_ prefix, i.e. ROLE_ADMIN, ROLE_USER, etc. Changing method to hasAuthority() resolves the issue.

Checkout this answer about this issue: https://stackoverflow.com/a/48055535

Change create-drop in application.yml to update

No further updates on this issue.
I will close it