代码分析基于 spring-security-oauth2-2.3.6.RELEASE
首先从整个流程图可以看到,用户发起的请求首先要经过一些Filter。
比如:客户端模式会首先经过OAuth2ClientAuthenticationProcessingFilter做校验后再放行,密码模式会经过UsernamePasswordAuthenticationFilter校验后放行......之后到达TokenEndpoint中请求到token的接口
图片来源:https://www.cnblogs.com/mxmbk/p/9952298.html
经过一系列的过滤器后就可以到达用户请求的接口了。下面分析授权获取token接口的逻辑
获取Token接口是:/oauth/token
该接口在 org.springframework.security.oauth2.provider.endpoint.TokenE