use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.
the class ImgurOAuthServiceImpl method createAccessTokenRequest.
@Override
protected OAuthRequest createAccessTokenRequest(String oauthVerifier) {
final DefaultApi20 api = getApi();
final OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
final OAuthConfig config = getConfig();
request.addBodyParameter(OAuthConstants.CLIENT_ID, config.getApiKey());
request.addBodyParameter(OAuthConstants.CLIENT_SECRET, config.getApiSecret());
if (ImgurApi.isOob(config)) {
request.addBodyParameter(OAuthConstants.GRANT_TYPE, "pin");
request.addBodyParameter("pin", oauthVerifier);
} else {
request.addBodyParameter(OAuthConstants.GRANT_TYPE, OAuthConstants.AUTHORIZATION_CODE);
request.addBodyParameter(OAuthConstants.CODE, oauthVerifier);
}
return request;
}
use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.
the class OAuth10aService method prepareRequestTokenRequest.
protected OAuthRequest prepareRequestTokenRequest() {
final OAuthRequest request = new OAuthRequest(api.getRequestTokenVerb(), api.getRequestTokenEndpoint());
final OAuthConfig config = getConfig();
config.log("setting oauth_callback to " + config.getCallback());
request.addOAuthParameter(OAuthConstants.CALLBACK, config.getCallback());
addOAuthParams(request, "");
appendSignature(request);
return request;
}
use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.
the class OAuth10aService method prepareAccessTokenRequest.
protected OAuthRequest prepareAccessTokenRequest(OAuth1RequestToken requestToken, String oauthVerifier) {
final OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
final OAuthConfig config = getConfig();
request.addOAuthParameter(OAuthConstants.TOKEN, requestToken.getToken());
request.addOAuthParameter(OAuthConstants.VERIFIER, oauthVerifier);
config.log("setting token to: " + requestToken + " and verifier to: " + oauthVerifier);
addOAuthParams(request, requestToken.getTokenSecret());
appendSignature(request);
return request;
}
use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.
the class ObjectMother method createSampleOAuthRequest.
public static OAuthRequest createSampleOAuthRequest() {
final OAuthRequest request = new OAuthRequest(Verb.GET, "http://example.com");
request.addOAuthParameter(OAuthConstants.TIMESTAMP, "123456");
request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, "AS#$^*@&");
request.addOAuthParameter(OAuthConstants.CALLBACK, "http://example/callback");
request.addOAuthParameter(OAuthConstants.SIGNATURE, "OAuth-Signature");
return request;
}
use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.
the class ObjectMother method createSampleOAuthRequestPort80.
public static OAuthRequest createSampleOAuthRequestPort80() {
final OAuthRequest request = new OAuthRequest(Verb.GET, "http://example.com:80");
request.addOAuthParameter(OAuthConstants.TIMESTAMP, "123456");
request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, "AS#$^*@&");
request.addOAuthParameter(OAuthConstants.CALLBACK, "http://example/callback");
request.addOAuthParameter(OAuthConstants.SIGNATURE, "OAuth-Signature");
return request;
}
Aggregations