Package net.oauth

Examples of net.oauth.OAuthServiceProvider


        message.getParameter("oauth_token_secret"));
  }

  private static OAuthConsumer getOAuthConsumer(OpenSocialClient client,
      OpenSocialProvider provider) {
    OAuthServiceProvider serviceProvider =
      new OAuthServiceProvider(provider.requestTokenUrl, provider.authorizeUrl,
          provider.accessTokenUrl);

    return new OAuthConsumer(null,
        client.getProperty(OpenSocialClient.Property.CONSUMER_KEY),
        client.getProperty(OpenSocialClient.Property.CONSUMER_SECRET),
View Full Code Here


  private void expectConsumer() {
    try {
      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

  private final OAuthServiceProvider SERVICE_PROVIDER;

  @Inject
  public GSOAuthDataStore( @Named("shindig.oauth.base-url") String baseUrl) {

    this.SERVICE_PROVIDER = new OAuthServiceProvider(baseUrl + "requestToken", baseUrl + "authorize", baseUrl + "accessToken");
  }
View Full Code Here

      String key = propertyName.split("\\.")[0];
      String parameter = propertyName.split("\\.")[1];

      OAuthAccessor accessor = accessors.get(key);
      if (accessor == null) {
        OAuthServiceProvider provider = new OAuthServiceProvider("", "", "");
        OAuthConsumer consumer = new OAuthConsumer("", "", "", provider);
        accessor = new OAuthAccessor(consumer);
        accessors.put(key, accessor);
      }

      if (parameter.equalsIgnoreCase(ACCESS_URL)) {
        OAuthServiceProvider provider = new OAuthServiceProvider(
            accessor.consumer.serviceProvider.requestTokenURL,
            accessor.consumer.serviceProvider.userAuthorizationURL,
            properties.getProperty(propertyName, "").trim());

        OAuthConsumer consumer = new OAuthConsumer("",
            accessor.consumer.consumerKey,
            accessor.consumer.consumerSecret,
            provider);
        OAuthAccessor newAccessor = new OAuthAccessor(consumer);
        copyProperties(newAccessor, accessor);
        accessors.put(key, newAccessor);

      } else if (parameter.equalsIgnoreCase(AUTH_URL)) {
        OAuthServiceProvider provider = new OAuthServiceProvider(
            accessor.consumer.serviceProvider.requestTokenURL,
            properties.getProperty(propertyName, "").trim(),
            accessor.consumer.serviceProvider.accessTokenURL);

        OAuthConsumer consumer = new OAuthConsumer("",
            accessor.consumer.consumerKey,
            accessor.consumer.consumerSecret,
            provider);
        OAuthAccessor newAccessor = new OAuthAccessor(consumer);
        copyProperties(newAccessor, accessor);
        accessors.put(key, newAccessor);


      } else if (parameter.equalsIgnoreCase(REQUEST_URL)) {
        OAuthServiceProvider provider = new OAuthServiceProvider(
            properties.getProperty(propertyName, "").trim(),
            accessor.consumer.serviceProvider.userAuthorizationURL,
            accessor.consumer.serviceProvider.accessTokenURL);

        OAuthConsumer consumer = new OAuthConsumer("",
View Full Code Here

  private int trustedParamCount;

  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

    // 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 responseParams.oauthRequestException(OAuthError.BAD_OAUTH_CONFIGURATION,
          e.getMessage());
    }
View Full Code Here

  }

  protected OAuthServiceProvider createOAuthServiceProvider()
  {
   
    OAuthServiceProvider p = new OAuthServiceProvider(
        this.getClientSettings().getOAuthRequestTokenUrl(),
        this.getClientSettings().getOAuthAuthorizeUrl(),
        this.getClientSettings().getOAuthAccessTokenUrl());
   
    return p;
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.