# SpringSecurity **Repository Path**: Edward-Z/SpringSecurity ## Basic Information - **Project Name**: SpringSecurity - **Description**: SpringSecurityRestful j简单demo - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-12-17 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 认证流程 ## 基本原理 ![1.png](http://wx3.sinaimg.cn/mw690/005OVSMDly1fyc3l6y239j30iy08qjti.jpg) ![1.png](http://wx2.sinaimg.cn/mw690/005OVSMDly1fyc3oatmk1j30ha0almyy.jpg) ## 流程 1.UsernamePasswordAuthenticationFilter 获取请求中的用户名密码 构建UsernamePasswordAuthenticationToken对象 Authentication(封装认证信息)接口的实现 setDetails设置请求信息 session ip等 2.getAuthenticationManager().authenticate(authRequest); 就到了AuthenticationManager 管理 AuthenticationProvider 3.AuthenticationProvider 真正的校验逻辑是在里面的 AuthenticationProvider循环 判断支不支持当前登录方式 挑出一个provide进行校验处理 拿到userdetail用户信息