当前位置: 首页>>代码示例>>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;未经允许,请勿转载。