com.flyfish.oauth.client.DefaultOAuth2SsoClient Maven / Gradle / Ivy
package com.flyfish.oauth.client;
import com.flyfish.oauth.configuration.*;
import com.flyfish.oauth.utils.CastUtils;
/**
* 统一认证客户端,负责接收配置
*
* @author wangyu
*/
public class DefaultOAuth2SsoClient implements OAuth2SsoClient {
private OAuth2SsoProperties properties;
private SSOSessionConverter sessionConverter = new DefaultSessionConverter();
private OAuth2SsoUserService userService;
/**
* 初始化方法,通知相关组件加载
*/
@Override
public void init() {
OAuth2SsoClientInitializer.initialize(this);
}
@Override
public void setUserInfoService(OAuth2SsoUserService userInfoService) {
this.userService = userInfoService;
}
@Override
public OAuth2SsoProperties getProperties() {
return properties;
}
@Override
public void setProperties(OAuth2SsoProperties properties) {
this.properties = properties;
}
@Override
public SSOSessionConverter getSessionConverter() {
return CastUtils.cast(sessionConverter);
}
@Override
public void setSessionConverter(SSOSessionConverter sessionConverter) {
this.sessionConverter = sessionConverter;
}
@Override
public OAuth2SsoUserService getUserService() {
return CastUtils.cast(userService);
}
}