koushikkothagal / spring-security-jpa

Code for full Spring Security + JPA + MySQL tutorial: https://youtu.be/TNt3GHuayXs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shows 403 Forbidden, even after cloning the same project.

mahedi99 opened this issue · comments

p

With the following snippet it works fine:
.antMatchers("/admin")..permitAll()

However, it doesn't work whenever I check by role:
.antMatchers("/admin").hasRole("ADMIN")

hasAuthority() instead of hasRole() solves the problem.

Since with `hsRole()' : 'ROLE_' prefix is automatically added