當前位置: 首頁>>代碼示例>>Java>>正文


Java OAuthRequest.addOAuthParameter方法代碼示例

本文整理匯總了Java中org.scribe.model.OAuthRequest.addOAuthParameter方法的典型用法代碼示例。如果您正苦於以下問題:Java OAuthRequest.addOAuthParameter方法的具體用法?Java OAuthRequest.addOAuthParameter怎麽用?Java OAuthRequest.addOAuthParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.scribe.model.OAuthRequest的用法示例。


在下文中一共展示了OAuthRequest.addOAuthParameter方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRequestToken

import org.scribe.model.OAuthRequest; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public Token getRequestToken()
{
	config.log("obtaining request token from " + api.getRequestTokenEndpoint());
	OAuthRequest request = new OAuthRequest(api.getRequestTokenVerb(), api.getRequestTokenEndpoint());

	config.log("setting oauth_callback to " + config.getCallback());
	request.addOAuthParameter(OAuthConstants.CALLBACK, config.getCallback());
	addOAuthParams(request, OAuthConstants.EMPTY_TOKEN);
	appendSignature(request);

	config.log("sending request...");
	Response response = request.send();
	String body = response.getBody();

	config.log("response status code: " + response.getCode());
	config.log("response body: " + body);
	return api.getRequestTokenExtractor().extract(body);
}
 
開發者ID:edgehosting,項目名稱:jira-dvcs-connector,代碼行數:23,代碼來源:TwoLoOAuth10aServiceImpl.java

示例2: addOAuthParams

import org.scribe.model.OAuthRequest; //導入方法依賴的package包/類
private void addOAuthParams(OAuthRequest request, Token token)
{
  request.addOAuthParameter(OAuthConstants.TIMESTAMP, api.getTimestampService().getTimestampInSeconds());
  request.addOAuthParameter(OAuthConstants.NONCE, api.getTimestampService().getNonce());
  request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, config.getApiKey());
  request.addOAuthParameter(OAuthConstants.SIGN_METHOD, api.getSignatureService().getSignatureMethod());
  request.addOAuthParameter(OAuthConstants.VERSION, getVersion());
  if(config.hasScope()) request.addOAuthParameter(OAuthConstants.SCOPE, config.getScope());
  request.addOAuthParameter(OAuthConstants.SIGNATURE, getSignature(request, token));

  config.log("appended additional OAuth parameters: " + MapUtils.toString(request.getOauthParameters()));
}
 
開發者ID:edgehosting,項目名稱:jira-dvcs-connector,代碼行數:13,代碼來源:HttpClientThrreeLoOAuth10aServiceImpl.java

示例3: signRequest

import org.scribe.model.OAuthRequest; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public void signRequest(Token token, OAuthRequest request)
{
  config.log("signing request: " + request.getCompleteUrl());
  request.addOAuthParameter(OAuthConstants.TOKEN, token.getToken());

  config.log("setting token to: " + token);
  addOAuthParams(request, token);
  appendSignature(request);
}
 
開發者ID:edgehosting,項目名稱:jira-dvcs-connector,代碼行數:13,代碼來源:HttpClientThrreeLoOAuth10aServiceImpl.java

示例4: addOAuthParams

import org.scribe.model.OAuthRequest; //導入方法依賴的package包/類
private void addOAuthParams(OAuthRequest request, Token token)
{
	request.addOAuthParameter(OAuthConstants.TIMESTAMP, api.getTimestampService().getTimestampInSeconds());
	request.addOAuthParameter(OAuthConstants.NONCE, api.getTimestampService().getNonce());
	request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, config.getApiKey());
	request.addOAuthParameter(OAuthConstants.SIGN_METHOD, api.getSignatureService().getSignatureMethod());
	request.addOAuthParameter(OAuthConstants.VERSION, getVersion());
	if (config.hasScope())
		request.addOAuthParameter(OAuthConstants.SCOPE, config.getScope());
	request.addOAuthParameter(OAuthConstants.SIGNATURE, getSignature(request, token));

	config.log("appended additional OAuth parameters: " + MapUtils.toString(request.getOauthParameters()));
}
 
開發者ID:edgehosting,項目名稱:jira-dvcs-connector,代碼行數:14,代碼來源:TwoLoOAuth10aServiceImpl.java

示例5: getAccessToken

import org.scribe.model.OAuthRequest; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public Token getAccessToken(Token requestToken, Verifier verifier)
{
	config.log("obtaining access token from " + api.getAccessTokenEndpoint());
	OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
	request.addOAuthParameter(OAuthConstants.TOKEN, requestToken.getToken());
	request.addOAuthParameter(OAuthConstants.VERIFIER, verifier.getValue());

	config.log("setting token to: " + requestToken + " and verifier to: " + verifier);
	addOAuthParams(request, requestToken);
	appendSignature(request);
	Response response = request.send();
	return api.getAccessTokenExtractor().extract(response.getBody());
}
 
開發者ID:edgehosting,項目名稱:jira-dvcs-connector,代碼行數:18,代碼來源:TwoLoOAuth10aServiceImpl.java


注:本文中的org.scribe.model.OAuthRequest.addOAuthParameter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。