spring security There was an unexpected error (type=Forbidden, status=403).

https://blog.csdn.net/qq_27093097/article/details/83190240

 

spring security There was an unexpected error (type=Forbidden, status=403).

 

原因是定义的角色名称不匹配

路径权限规则匹配中配置的是:ADMIN 这里程序猿不可以配置ROLE_开头的角色 不然直接报BUG

自定义权限验证中就要配置用户的权限:ROLE_ADMIN 需要加上ROLE_开头

这坑踩了两回 这设计很想吐槽

posted @ 2019-12-14 11:57  weizhxa  阅读(3650)  评论(1编辑  收藏  举报