All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.shawven.security.connect.ConnectInfoExtendable Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version

package com.github.shawven.security.connect;

import org.springframework.social.connect.Connection;

/**
 * 社交信息扩展方法
 *
 * @author Shoven
 * @date 2019-11-08
 */
public class ConnectInfoExtendable {

	/**
	 * 根据Connection信息构建SocialUserInfo
     *
	 * @param connection
	 * @return
	 */
	protected ConnectUserInfo buildSocialUserInfo(Connection connection) {
		ConnectUserInfo userInfo = new ConnectUserInfo();
		userInfo.setProviderId(connection.getKey().getProviderId());
		userInfo.setProviderUserId(connection.getKey().getProviderUserId());
		userInfo.setNickname(connection.getDisplayName());
		userInfo.setHeadimg(connection.getImageUrl());
		return userInfo;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy