Package net.oauth

Examples of net.oauth.OAuthServiceProvider


      EasyMock
          .expect(
              mockStore.getConsumer(EasyMock.eq(FakeOAuthRequest.CONSUMER_KEY)))
          .andReturn(
              new OAuthConsumer(null, FakeOAuthRequest.CONSUMER_KEY,
                  FakeOAuthRequest.CONSUMER_SECRET, new OAuthServiceProvider(
                      null, null, null))).anyTimes();
    } catch (OAuthProblemException e) {
      // ignore
    }
  }
View Full Code Here


    // Pick up any additional information needed about the format of the request, either from
    // options to makeRequest, or options from the spec, or from sensible defaults.  This is how
    // we figure out where to put the OAuth parameters and what methods to use for the OAuth
    // URLs.
    OAuthServiceProvider provider = null;
    if (arguments.programmaticConfig()) {
      provider = loadProgrammaticConfig(arguments, accessorBuilder, responseParams);
    } else if (arguments.mayUseToken()) {
      provider = lookupSpecInfo(securityToken, arguments, accessorBuilder, responseParams);
    } else {
View Full Code Here

    // access token requests, but that's probably not useful.  We just use the request token
    // rules for everything.
    accessorBuilder.setParameterLocation(
        getStoreLocation(service.getRequestUrl().location, responseParams));
    accessorBuilder.setMethod(getStoreMethod(service.getRequestUrl().method, responseParams));
    return new OAuthServiceProvider(
        service.getRequestUrl().url.toJavaUri().toASCIIString(),
        service.getAuthorizationUrl().toJavaUri().toASCIIString(),
        service.getAccessUrl().url.toJavaUri().toASCIIString());
  }
View Full Code Here

      String accessTokenUrl = arguments.getRequestOption(OAuthArguments.ACCESS_TOKEN_URL_PARAM);
      verifyUrl(accessTokenUrl, responseParams);

      String authorizationUrl = arguments.getRequestOption(OAuthArguments.AUTHORIZATION_URL_PARAM);
      verifyUrl(authorizationUrl, responseParams);
      return new OAuthServiceProvider(requestTokenUrl, authorizationUrl, accessTokenUrl);
    } catch (SpecParserException e) {
      // these exceptions have decent programmer readable messages
      throw new OAuthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          e.getMessage());
    }
View Full Code Here

      EasyMock
          .expect(
              mockStore.getConsumer(EasyMock.eq(FakeOAuthRequest.CONSUMER_KEY)))
          .andReturn(
              new OAuthConsumer(null, FakeOAuthRequest.CONSUMER_KEY,
                  FakeOAuthRequest.CONSUMER_SECRET, new OAuthServiceProvider(
                      null, null, null))).anyTimes();
    } catch (OAuthProblemException e) {
      // ignore
    }
  }
View Full Code Here

        this.strategy = strategy;
        this.validator = validator;
    }
   
    public OAuthServiceProvider getServiceProvider() {
        return new OAuthServiceProvider(
            roller.getUrlStrategy().getOAuthRequestTokenURL(),
            roller.getUrlStrategy().getOAuthAuthorizationURL(),
            roller.getUrlStrategy().getOAuthAccessTokenURL());
    }
View Full Code Here

 
  @Test
  public void testInit() throws Exception {
    FakeGadgetToken t = new FakeGadgetToken();
    t.setAppUrl("http://localhost:8080/gadgets/files/samplecontainer/examples/oauth.xml");
    OAuthServiceProvider provider = new OAuthServiceProvider("req", "authorize", "access");
    ConsumerInfo consumerInfo = store.getConsumerKeyAndSecret(t, "", provider);
    OAuthConsumer consumer = consumerInfo.getConsumer();
    assertEquals("gadgetConsumer", consumer.consumerKey);
    assertEquals("gadgetSecret", consumer.consumerSecret);
    assertEquals("HMAC-SHA1", consumer.getProperty("oauth_signature_method"));
View Full Code Here

 
  @Test
  public void testDefaultKey() throws Exception {
    FakeGadgetToken t = new FakeGadgetToken();
    t.setAppUrl("http://localhost:8080/not-in-store.xml");
    OAuthServiceProvider provider = new OAuthServiceProvider("req", "authorize", "access");

    try {
      store.getConsumerKeyAndSecret(t, "", provider);
      fail();
    } catch (GadgetException e) {
View Full Code Here

  private Set<OAuthParamLocation> validParamLocations;

  public FakeOAuthServiceProvider(TimeSource clock) {
    this.clock = clock;
    OAuthServiceProvider provider = new OAuthServiceProvider(
        REQUEST_TOKEN_URL, APPROVAL_URL, ACCESS_TOKEN_URL);
   
    signedFetchConsumer = new OAuthConsumer(null, null, null, null);
    signedFetchConsumer.setProperty(RSA_SHA1.X509_CERTIFICATE, CERTIFICATE_TEXT);
View Full Code Here

  private final OAuthServiceProvider SERVICE_PROVIDER;

  @Inject
  public SampleOAuthDataStore(JsonDbOpensocialService dbService, @Named("shindig.oauth.base-url") String baseUrl) {
    this.service = dbService;
    this.SERVICE_PROVIDER = new OAuthServiceProvider(baseUrl + "/requestToken", baseUrl + "/authorize", baseUrl + "/accessToken");
  }
View Full Code Here

TOP

Related Classes of net.oauth.OAuthServiceProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.