| | |
| | | @EnableWebSecurity |
| | | @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) |
| | | public class WebSecurityConfig extends WebSecurityConfigurerAdapter { |
| | | private final SecurityAuthenticationEntryPoint securityAuthenticationEntryPoint; |
| | | private final RedisAutoTemplate redisAutoTemplate; |
| | | private final CaffineCache<String> accessTokenCache; |
| | | private final CaffineCache<String> refreshTokenCache; |
| | | private final SysUserDetailsService loadUserDetailsService; |
| | | private final PasswordEncoder passwordEncoder; |
| | | |
| | | @Autowired |
| | | public WebSecurityConfig(SecurityAuthenticationEntryPoint securityAuthenticationEntryPoint, RedisAutoTemplate redisAutoTemplate, CaffineCache<String> accessTokenCache, CaffineCache<String> refreshTokenCache, SysUserDetailsService loadUserDetailsService, PasswordEncoder passwordEncoder) { |
| | | this.securityAuthenticationEntryPoint = securityAuthenticationEntryPoint; |
| | | this.redisAutoTemplate = redisAutoTemplate; |
| | | this.accessTokenCache = accessTokenCache; |
| | | this.refreshTokenCache = refreshTokenCache; |
| | | this.loadUserDetailsService = loadUserDetailsService; |
| | | this.passwordEncoder = passwordEncoder; |
| | | } |
| | | private SecurityAuthenticationEntryPoint securityAuthenticationEntryPoint; |
| | | @Autowired |
| | | private RedisAutoTemplate redisAutoTemplate; |
| | | @Autowired |
| | | private CaffineCache<String> accessTokenCache; |
| | | @Autowired |
| | | private CaffineCache<String> refreshTokenCache; |
| | | @Autowired |
| | | private PasswordEncoder passwordEncoder; |
| | | @Autowired |
| | | private SysUserDetailsService loadUserDetailsService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void configure(AuthenticationManagerBuilder auth) { |
| | | auth.authenticationProvider(new AuthenticationProvider(loadUserDetailsService, passwordEncoder)); |
| | | auth.authenticationProvider(new AuthenticationProvider(loadUserDetailsService,passwordEncoder)); |
| | | } |
| | | |
| | | |