Search in sources :

Example 41 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class ObjectMother method createSampleOAuthRequestPort443v2.

public static OAuthRequest createSampleOAuthRequestPort443v2() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "https://example.com:443/test");
    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;
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest)

Example 42 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class ObjectMother method createSampleOAuthRequestPort8080.

public static OAuthRequest createSampleOAuthRequestPort8080() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "http://example.com:8080");
    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;
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest)

Example 43 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class ObjectMother method createSampleOAuthRequestPort443.

public static OAuthRequest createSampleOAuthRequestPort443() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "https://example.com:443");
    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;
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest)

Example 44 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class BaseStringExtractorTest method shouldThrowExceptionIfRquestHasNoOAuthParameters.

@Test(expected = OAuthParametersMissingException.class)
public void shouldThrowExceptionIfRquestHasNoOAuthParameters() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "http://example.com");
    extractor.extract(request);
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest) Test(org.junit.Test)

Example 45 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class HeaderExtractorTest method shouldExceptionIfRequestHasNoOAuthParams.

@Test(expected = OAuthParametersMissingException.class)
public void shouldExceptionIfRequestHasNoOAuthParams() {
    final OAuthRequest emptyRequest = new OAuthRequest(Verb.GET, "http://example.com");
    extractor.extract(emptyRequest);
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest) Test(org.junit.Test)

Aggregations

OAuthRequest (com.github.scribejava.core.model.OAuthRequest)71 Response (com.github.scribejava.core.model.Response)56 ServiceBuilder (com.github.scribejava.core.builder.ServiceBuilder)49 Scanner (java.util.Scanner)49 OAuth20Service (com.github.scribejava.core.oauth.OAuth20Service)31 OAuth2AccessToken (com.github.scribejava.core.model.OAuth2AccessToken)30 OAuth1AccessToken (com.github.scribejava.core.model.OAuth1AccessToken)19 OAuth1RequestToken (com.github.scribejava.core.model.OAuth1RequestToken)19 OAuth10aService (com.github.scribejava.core.oauth.OAuth10aService)18 Random (java.util.Random)11 OAuthConfig (com.github.scribejava.core.model.OAuthConfig)9 Test (org.junit.Test)6 HashMap (java.util.HashMap)4 NingHttpClientConfig (com.github.scribejava.httpclient.ning.NingHttpClientConfig)3 AsyncHttpClientConfig (com.ning.http.client.AsyncHttpClientConfig)3 HttpUrl (okhttp3.HttpUrl)3 MockResponse (okhttp3.mockwebserver.MockResponse)3 MockWebServer (okhttp3.mockwebserver.MockWebServer)3 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)3 SalesforceToken (com.github.scribejava.apis.salesforce.SalesforceToken)2