SpringSecurity 官方文档地址是:
https://projects.spring.io/spring-security/
主要的类:
1:
org.springframework.security.core.userdetails.UserDetails
实现这个接口类主要是把用户是否禁止登录,用户密码是否过期,用户密码信息,授权的角色信息,告诉SpringSecurity。
2:
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
配置类,继承了它,可以把一些自定义的Fillter 添加到Filter链里面去,设置一些允许访问资源的路径,
3 :
org.springframework.security.web.access.AccessDeniedHandler
实现这个接口,重写handle方法,可以设置返回信息。
4:
org.springframework.security.web.AuthenticationEntryPoint
实现这个接口,重写commence方法,可以设置异常返回信息描述。
5:
org.springframework.web.filter.OncePerRequestFilter
继承这个类,可以进行自定义的拦截。比如和token交互。
6:
org.springframework.security.access.intercept.AbstractSecurityInterceptor
这个类比较重要,继承它,可以实现url级权限控制。beforeInvocation
7:
org.springframework.security.core.userdetails.UserDetailsService