Spring Security - Access is denied (user is not anonymous) spring-security-core-4.0.3.RELEASE

前端 未结 5 857
暗喜
暗喜 2020-12-15 06:58

can anyone see an failure in this Spring Security Config File?

After Login the i get a debug message:

Access is denied (user is not anonymous)

5条回答
  •  被撕碎了的回忆
    2020-12-15 07:22

    This worked for me - hasAuthority("ROLE_USER")

    Try with @RolesAllowed("USER") instead of @RolesAllowed("ROLE_USER"). Eventually you could use hasAuthority("ROLE_USER") or hasRole("USER") instead of hasRole("ROLE_USER") .

提交回复
热议问题