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_开头

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

猜你喜欢

转载自www.cnblogs.com/weizhxa/p/12038623.html