Java Code Examples for org.springframework.social.connect.ConnectionValues#setProviderUserId()

The following examples show how to use org.springframework.social.connect.ConnectionValues#setProviderUserId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WechatAdapter.java    From cola with MIT License 5 votes vote down vote up
@Override
public void setConnectionValues(Wechat api, ConnectionValues values) {
    WechatUserInfo userInfo = api.getUserInfo(openId);
    values.setProviderUserId(userInfo.getUnionid());
    values.setDisplayName(userInfo.getNickname());
    values.setImageUrl(userInfo.getHeadimgurl());
}
 
Example 2
Source File: QQAdapter.java    From cola with MIT License 5 votes vote down vote up
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
	QQUserInfo userInfo = api.getUserInfo();

	//openid 唯一标识
	values.setProviderUserId(userInfo.getOpenId());
	values.setDisplayName(userInfo.getNickname());
	values.setImageUrl(userInfo.getFigureurl_2());
	values.setProfileUrl(null);
}
 
Example 3
Source File: WechatMpAdapter.java    From cola with MIT License 5 votes vote down vote up
@Override
public void setConnectionValues(WechatMp api, ConnectionValues values) {
    WechatMpUserInfo userInfo = api.getUserInfo(openId);
    values.setProviderUserId(userInfo.getUnionid());
    values.setDisplayName(userInfo.getNickname());
    values.setImageUrl(userInfo.getHeadimgurl());
}
 
Example 4
Source File: AlipayAdapater.java    From cola with MIT License 5 votes vote down vote up
@Override
public void setConnectionValues(Alipay api, ConnectionValues values) {
	AlipayUserInfo alipayUserInfo = api.getUserInfo();
	values.setDisplayName(alipayUserInfo.getNickName());
	values.setImageUrl(alipayUserInfo.getAvatar());
	values.setProviderUserId(alipayUserInfo.getUserId());
}
 
Example 5
Source File: GitHubAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setConnectionValues(GitHub api, ConnectionValues values) {
    GitHubUserInfo userInfo = api.getUserInfo();
    values.setProviderUserId(String.valueOf(userInfo.getId()));
    values.setDisplayName(userInfo.getUsername());
    values.setProfileUrl("https://github.com/" + userInfo.getId());
    values.setImageUrl(userInfo.getAvatarUrl());
}
 
Example 6
Source File: GiteeAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setConnectionValues(Gitee api, ConnectionValues values) {
    GiteeUserInfo userInfo = api.getUserInfo();
    values.setProviderUserId(String.valueOf(userInfo.getId()));
    values.setDisplayName(userInfo.getName());
    values.setProfileUrl(userInfo.getHtmlUrl());
    values.setImageUrl(userInfo.getAvatarUrl());
}
 
Example 7
Source File: QQAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 将服务提供商个性化的用户信息映射到ConnectionValues标准的数据化结构上
 * @param qq
 * @param connectionValues
 */
@Override
public void setConnectionValues(QQ qq, ConnectionValues connectionValues) {
    QQUserInfo userInfo = qq.getUserInfo();
    //显示的用户名称
    connectionValues.setDisplayName(userInfo.getNickname());
    //用户的头像
    connectionValues.setImageUrl(userInfo.getFigureurl_qq_1());
    //个人主页
    connectionValues.setProfileUrl(null);
    //QQ的唯一标识
    connectionValues.setProviderUserId(userInfo.getOpenId());
}
 
Example 8
Source File: WeixinAdapter.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setConnectionValues(Weixin api, ConnectionValues values) {
    WeixinUserInfo userInfo = api.getUserInfo(openId);
    values.setProviderUserId(userInfo.getOpenid());
    values.setDisplayName(userInfo.getNickname());
    values.setImageUrl(userInfo.getHeadimgurl());
}
 
Example 9
Source File: QQAdapter.java    From paascloud-master with Apache License 2.0 5 votes vote down vote up
/**
 * Sets connection values.
 *
 * @param api    the api
 * @param values the values
 */
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
	QQUserInfo userInfo = api.getUserInfo();

	values.setDisplayName(userInfo.getNickname());
	values.setImageUrl(userInfo.getFigureUrlQq1());
	values.setProfileUrl(null);
	values.setProviderUserId(userInfo.getOpenId());
}
 
Example 10
Source File: WeixinAdapter.java    From paascloud-master with Apache License 2.0 5 votes vote down vote up
/**
 * Sets connection values.
 *
 * @param api    the api
 * @param values the values
 */
@Override
public void setConnectionValues(Weixin api, ConnectionValues values) {
	WeixinUserInfo profile = api.getUserInfo(openId);
	values.setProviderUserId(profile.getOpenid());
	values.setDisplayName(profile.getNickname());
	values.setImageUrl(profile.getHeadimgurl());
}
 
Example 11
Source File: QQAdapter.java    From FEBS-Security with Apache License 2.0 5 votes vote down vote up
@Override
public void setConnectionValues(QQ api, ConnectionValues values) {
    QQUserInfo qqUserInfo = api.getUserInfo();
    values.setDisplayName(qqUserInfo.getNickname());
    values.setImageUrl(qqUserInfo.getFigureurl_qq_2());
    values.setProfileUrl(null);
    values.setProviderUserId(qqUserInfo.getOpenId());
}
 
Example 12
Source File: WeiXinAdapter.java    From FEBS-Security with Apache License 2.0 5 votes vote down vote up
@Override
public void setConnectionValues(WeiXin api, ConnectionValues values) {
    WeiXinUserInfo profile = api.getUserInfo(openId);
    values.setProviderUserId(profile.getOpenid());
    values.setDisplayName(profile.getNickname());
    values.setImageUrl(profile.getHeadimgurl());
}
 
Example 13
Source File: GooglePlusAdapter.java    From google-plus-java-api with Apache License 2.0 5 votes vote down vote up
public void setConnectionValues(Plus api, ConnectionValues values) {
    Person person = api.getPeopleOperations().get("me");
    values.setProviderUserId(person.getId());
    values.setDisplayName(person.getName().getFormatted());
    values.setProfileUrl(person.getUrl());
    values.setImageUrl(person.getImage().getUrl());
}