AccessDeniedException: spring security 认证中的一个小坑(bug集2)

882 阅读1分钟

情况: 后端测试成功,前端对接测试的时候 出现这个问题

org.springframework.security.access.AccessDeniedException: 不允许访问
at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:73)
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.attemptAuthorization(AbstractSecurityInterceptor.java:238)
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:208)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:58)

这个问题 解决办法 : token格式出现错误 大概率是没有权限403 但是没有失败处理器拦截

本次解决办法: 重新登录 重新填写token 进行postman测试 后成功