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


Java Token.getRawResponse方法代码示例

本文整理汇总了Java中org.scribe.model.Token.getRawResponse方法的典型用法代码示例。如果您正苦于以下问题:Java Token.getRawResponse方法的具体用法?Java Token.getRawResponse怎么用?Java Token.getRawResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.scribe.model.Token的用法示例。


在下文中一共展示了Token.getRawResponse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: signRequest

import org.scribe.model.Token; //导入方法依赖的package包/类
@Override
public void signRequest(final Token accessToken, final OAuthRequest request) {
    request.addQuerystringParameter(OAuthConstants.ACCESS_TOKEN, accessToken.getToken());
    String response = accessToken.getRawResponse();
    Matcher matcher = openIdPattern.matcher(response);
    if (matcher.find()) {
        request.addQuerystringParameter("openid", matcher.group(1));
    } else {
        throw new OAuthException("微信接口返回数据miss openid: " + response);
    }
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:12,代码来源:WeiXinOAuth20ServiceImpl.java

示例2: getAccessToken

import org.scribe.model.Token; //导入方法依赖的package包/类
@Override
public OAuthToken getAccessToken(OAuthVerifier rv) {
  Verifier vi = new Verifier(rv.getValue());
  Token to = service.getAccessToken(null, vi);
  OAuthToken result = new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());
  return result;
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:8,代码来源:GoogleOAuthService.java

示例3: getAccessToken

import org.scribe.model.Token; //导入方法依赖的package包/类
@Override
public OAuthToken getAccessToken(OAuthVerifier rv) {
  Verifier vi = new Verifier(rv.getValue());
  Token to = service.getAccessToken(null, vi);
  OAuthToken result = new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());

  return result;
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:9,代码来源:FacebookOAuthService.java

示例4: finishAuthorization

import org.scribe.model.Token; //导入方法依赖的package包/类
public boolean finishAuthorization(Activity activity, int resultCode, Intent data) {
    if (resultCode != Activity.RESULT_OK || data == null) {
        return false;
    }

    String url = data.getStringExtra(EvernoteUtil.EXTRA_OAUTH_CALLBACK_URL);
    if (TextUtils.isEmpty(url)) {
        return false;
    }

    Uri uri = Uri.parse(url);

    String verifierString = uri.getQueryParameter("oauth_verifier");
    String appLnbString = uri.getQueryParameter("sandbox_lnb");
    boolean isAppLinkedNotebook = !TextUtils.isEmpty(appLnbString) && "true".equalsIgnoreCase(appLnbString);

    if (TextUtils.isEmpty(verifierString)) {
        CAT.i("User did not authorize access");
        return false;
    }

    Verifier verifier = new Verifier(verifierString);
    try {
        Token accessToken = mOAuthService.getAccessToken(mRequestToken, verifier);
        String rawResponse = accessToken.getRawResponse();

        String authToken = accessToken.getToken();
        String noteStoreUrl = extract(rawResponse, NOTE_STORE_REGEX);
        String webApiUrlPrefix = extract(rawResponse, WEB_API_REGEX);
        int userId = Integer.parseInt(extract(rawResponse, USER_ID_REGEX));

        String evernoteHost = mBootstrapProfile.getSettings().getServiceHost();

        AuthenticationResult authenticationResult = new AuthenticationResult(authToken, noteStoreUrl, webApiUrlPrefix, evernoteHost, userId, isAppLinkedNotebook);
        authenticationResult.persist();
        mSession.setAuthenticationResult(authenticationResult);
        return true;

    } catch (Exception e) {
        CAT.e("Failed to obtain OAuth access token", e);
    }

    return false;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:45,代码来源:EvernoteOAuthHelper.java

示例5: getAccessToken

import org.scribe.model.Token; //导入方法依赖的package包/类
@Override
public OAuthToken getAccessToken(OAuthVerifier rv) {
  Verifier vi = new Verifier(rv.getValue());
  Token to = service.getAccessToken(null, vi);
  return new OAuthToken(to.getToken(), to.getSecret(), to.getRawResponse());
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:7,代码来源:CasOAuthService.java

示例6: EvernoteAuthToken

import org.scribe.model.Token; //导入方法依赖的package包/类
public EvernoteAuthToken(Token token) {
  super(token.getToken(), token.getSecret(), token.getRawResponse());
  this.mNoteStoreUrl = extract(getRawResponse(), NOTESTORE_REGEX);
  this.mWebApiUrlPrefix = extract(getRawResponse(), WEBAPI_REGEX);
  this.mUserId = Integer.parseInt(extract(getRawResponse(), USERID_REGEX));
}
 
开发者ID:duanze,项目名称:PureNote,代码行数:7,代码来源:EvernoteAuthToken.java


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