本文整理汇总了Java中com.github.scribejava.core.builder.api.DefaultApi20类的典型用法代码示例。如果您正苦于以下问题:Java DefaultApi20类的具体用法?Java DefaultApi20怎么用?Java DefaultApi20使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultApi20类属于com.github.scribejava.core.builder.api包,在下文中一共展示了DefaultApi20类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveUserProfileFromToken
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
@Override
protected FacebookProfile retrieveUserProfileFromToken(final OAuth2AccessToken accessToken) throws HttpAction {
String body = sendRequestForData(accessToken, getProfileUrl(accessToken));
if (body == null) {
throw new HttpCommunicationException("Not data found for accessToken: " + accessToken);
}
final FacebookProfile profile = extractUserProfile(body);
addAccessTokenToProfile(profile, accessToken);
if (profile != null && this.requiresExtendedToken) {
String url = CommonHelper.addParameter(EXCHANGE_TOKEN_URL, OAuthConstants.CLIENT_ID, getKey());
url = CommonHelper.addParameter(url, OAuthConstants.CLIENT_SECRET, getSecret());
url = addExchangeToken(url, accessToken);
final OAuthRequest request = createOAuthRequest(url);
final long t0 = System.currentTimeMillis();
final Response response = request.send();
final int code = response.getCode();
body = response.getBody();
final long t1 = System.currentTimeMillis();
logger.debug("Request took: " + (t1 - t0) + " ms for: " + url);
logger.debug("response code: {} / response body: {}", code, body);
if (code == 200) {
logger.debug("Retrieve extended token from {}", body);
final OAuth2AccessToken extendedAccessToken = ((DefaultApi20) getApi()).getAccessTokenExtractor().extract(body);
logger.debug("Extended token: {}", extendedAccessToken);
addAccessTokenToProfile(profile, extendedAccessToken);
} else {
logger.error("Cannot get extended token: {} / {}", code, body);
}
}
return profile;
}
示例2: OAuthProvider
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
private OAuthProvider(String providerName, String apiKey, String apiSecret, String callbackURL, DefaultApi20 api) {
this.providerName = providerName;
this.apiKey = apiKey;
this.apiSecret = apiSecret;
this.callbackURL = callbackURL;
this.api = api;
}
示例3: SlackOAuth20ServiceImpl
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public SlackOAuth20ServiceImpl (DefaultApi20 api, OAuthConfig config) {
super(api, config);
}
示例4: Foursquare20Service
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public Foursquare20Service(DefaultApi20 api, OAuthConfig config) {
super(api, config);
}
示例5: internalInit
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
@Override
protected void internalInit(final WebContext context) {
super.internalInit(context);
this.service = new Foursquare20Service((DefaultApi20) getApi(), buildOAuthConfig(context));
}
示例6: WeixinOAuthService
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public WeixinOAuthService(DefaultApi20 api, OAuthConfig config) {
super(api, config);
}
示例7: getApi
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public DefaultApi20 getApi() {
return api;
}
示例8: Fitbit20ServiceImpl
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public Fitbit20ServiceImpl(DefaultApi20 api, OAuthConfig config) {
super(api, config);
}
示例9: LinkedInOAuthService
import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
/**
* Default constructor
*
* @param api OAuth2.0 api information
* @param config OAuth 2.0 configuration param object
*/
public LinkedInOAuthService(DefaultApi20 api, OAuthConfig config) {
super(api, config);
}