本文整理匯總了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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));
}