package com.kidgrow.oauth2.openid;
|
|
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.social.security.SocialUserDetailsService;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
|
*
|
* @Description: OpenID相关配置<br>
|
* @Project: <br>
|
* @CreateDate: Created in 2020/2/20 09:41 <br>
|
* @Author: <a href="4345453@kidgrow.com">liuke</a>
|
*/
|
@Component
|
public class OpenIdAuthenticationSecurityConfig extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {
|
@Autowired
|
private SocialUserDetailsService userDetailsService;
|
|
@Override
|
public void configure(HttpSecurity http) {
|
//openId provider
|
OpenIdAuthenticationProvider provider = new OpenIdAuthenticationProvider();
|
provider.setUserDetailsService(userDetailsService);
|
http.authenticationProvider(provider);
|
}
|
}
|