当前位置: 首页>>代码示例>>Java>>正文


Java DefaultApi20类代码示例

本文整理汇总了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;
}
 
开发者ID:yaochi,项目名称:pac4j-plus,代码行数:32,代码来源:FacebookClient.java

示例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;
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:8,代码来源:OAuthProvider.java

示例3: SlackOAuth20ServiceImpl

import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public SlackOAuth20ServiceImpl (DefaultApi20 api, OAuthConfig config) {
    super(api, config);
}
 
开发者ID:sjsucohort6,项目名称:amigo-chatbot,代码行数:4,代码来源:SlackOAuth20ServiceImpl.java

示例4: Foursquare20Service

import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public Foursquare20Service(DefaultApi20 api, OAuthConfig config) {
    super(api, config);
}
 
开发者ID:yaochi,项目名称:pac4j-plus,代码行数:4,代码来源:Foursquare20Service.java

示例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));
}
 
开发者ID:yaochi,项目名称:pac4j-plus,代码行数:6,代码来源:FoursquareClient.java

示例6: WeixinOAuthService

import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public WeixinOAuthService(DefaultApi20 api, OAuthConfig config) {
    super(api, config);
}
 
开发者ID:perrywang,项目名称:OAuthGateway,代码行数:4,代码来源:WeixinOAuthService.java

示例7: getApi

import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public DefaultApi20 getApi() {
	return api;
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:4,代码来源:OAuthProvider.java

示例8: Fitbit20ServiceImpl

import com.github.scribejava.core.builder.api.DefaultApi20; //导入依赖的package包/类
public Fitbit20ServiceImpl(DefaultApi20 api, OAuthConfig config) {
    super(api, config);
}
 
开发者ID:alexthered,项目名称:fitbitAPI20-scribe-java,代码行数:4,代码来源:Fitbit20ServiceImpl.java

示例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);
}
 
开发者ID:perrywang,项目名称:OAuthGateway,代码行数:10,代码来源:LinkedInOAuthService.java


注:本文中的com.github.scribejava.core.builder.api.DefaultApi20类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。