Java Code Examples for org.springframework.social.oauth2.AccessGrant#getAccessToken()

The following examples show how to use org.springframework.social.oauth2.AccessGrant#getAccessToken() . 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: GooglePlusFactory.java    From google-plus-java-api with Apache License 2.0 5 votes vote down vote up
public String refreshToken() {
    if (refreshToken == null) {
        return null;
    }
    AccessGrant grant = GooglePlusFactory.this.getOAuthOperations().refreshAccess(refreshToken, null);
    if (listener != null) {
        listener.tokensRefreshed(accessToken, grant);
    }
    return grant.getAccessToken();
}
 
Example 2
Source File: WechatConnectionFactory.java    From cola with MIT License 4 votes vote down vote up
@Override
public Connection<Wechat> createConnection(AccessGrant accessGrant) {
    return new OAuth2Connection<>(getProviderId(), extractProviderUserId(accessGrant), accessGrant.getAccessToken(),
            accessGrant.getRefreshToken(), accessGrant.getExpireTime(), getOAuth2ServiceProvider(), getApiAdapter(extractProviderUserId(accessGrant)));
}
 
Example 3
Source File: WechatMpConnectionFactory.java    From cola with MIT License 4 votes vote down vote up
@Override
public Connection<WechatMp> createConnection(AccessGrant accessGrant) {
    return new OAuth2Connection<>(getProviderId(), extractProviderUserId(accessGrant), accessGrant.getAccessToken(),
            accessGrant.getRefreshToken(), accessGrant.getExpireTime(), getOAuth2ServiceProvider(), getApiAdapter(extractProviderUserId(accessGrant)));
}
 
Example 4
Source File: WeixinConnectionFactory.java    From pre with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Connection<Weixin> createConnection(AccessGrant accessGrant) {
    return new OAuth2Connection<Weixin>(getProviderId(), extractProviderUserId(accessGrant), accessGrant.getAccessToken(),
            accessGrant.getRefreshToken(), accessGrant.getExpireTime(), getOAuth2ServiceProvider(), getApiAdapter(extractProviderUserId(accessGrant)));
}
 
Example 5
Source File: WeiXinConnectionFactory.java    From FEBS-Security with Apache License 2.0 4 votes vote down vote up
@Override
public Connection<WeiXin> createConnection(AccessGrant accessGrant) {
    return new OAuth2Connection<>(getProviderId(), extractProviderUserId(accessGrant), accessGrant.getAccessToken(),
            accessGrant.getRefreshToken(), accessGrant.getExpireTime(), getOAuth2ServiceProvider(), getApiAdapter(extractProviderUserId(accessGrant)));
}
 
Example 6
Source File: YahooOAuth2ConnectionFactory.java    From cloudstreetmarket.com with GNU General Public License v3.0 4 votes vote down vote up
public Connection<Yahoo2> createConnection(AccessGrant accessGrant) {
	return new OAuth2Connection<Yahoo2>(getProviderId(), extractProviderUserId(accessGrant), accessGrant.getAccessToken(),
			accessGrant.getRefreshToken(), accessGrant.getExpireTime(), getOAuth2ServiceProviderWithGuid(accessGrant), getApiAdapter());		
}
 
Example 7
Source File: WeixinConnectionFactory.java    From paascloud-master with Apache License 2.0 2 votes vote down vote up
/**
 * Create connection connection.
 *
 * @param accessGrant the access grant
 *
 * @return the connection
 */
@Override
public Connection<Weixin> createConnection(AccessGrant accessGrant) {
	return new OAuth2Connection<>(getProviderId(), extractProviderUserId(accessGrant), accessGrant.getAccessToken(),
			accessGrant.getRefreshToken(), accessGrant.getExpireTime(), getOAuth2ServiceProvider(), getApiAdapter(extractProviderUserId(accessGrant)));
}