package com.ruoyi.framework.wxopenidConfig;
|
|
import com.ruoyi.framework.web.service.WxOpenIDUserDetailsServiceImpl;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.web.DefaultSecurityFilterChain;
|
import org.springframework.stereotype.Component;
|
|
@Component
|
public class WxOpenIDAuthenticationSecurityConfig extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {
|
@Autowired
|
private WxOpenIDUserDetailsServiceImpl userDetailsService;
|
|
@Override
|
public void configure(HttpSecurity http) throws Exception {
|
|
WxOpenIDAuthenticationProvider wxopenidAuthenticationProvider = new WxOpenIDAuthenticationProvider();
|
wxopenidAuthenticationProvider.setUserDetailsService(userDetailsService);
|
|
http.authenticationProvider(wxopenidAuthenticationProvider);
|
|
}
|
}
|