Package net.oauth

Examples of net.oauth.OAuthServiceProvider


    // 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

    String callbackUrl = null;
    String consumerSecret = props.getProperty("consumerSecret");
    String reqUrl = props.getProperty("requestUrl");
    String authzUrl = props.getProperty("authorizationUrl");
    String accessUrl = props.getProperty("accessUrl");
    OAuthServiceProvider provider = new OAuthServiceProvider(reqUrl,
        authzUrl, accessUrl);
    OAuthConsumer consumer = new OAuthConsumer(callbackUrl, consumerKey,
        consumerSecret, provider);
    return new OAuthAccessor(consumer);
  }
View Full Code Here

    if (updateStatus != null) {
      // the parameter used by twitter on
      message.addParameter("status", updateStatus);
    }

    OAuthServiceProvider provider = new OAuthServiceProvider(props
        .getProperty("requestUrl"), props
        .getProperty("authorizationUrl"), props
        .getProperty("accessUrl"));
    OAuthConsumer consumer = new OAuthConsumer("", props
        .getProperty("consumerKey"), props
View Full Code Here

        OAuthConsumerStore consumerStore = new OAuthConsumerStore();
        consumerStore.setGadgetUri(GADGET_URI);
        consumerStore.setConsumerKey("gadgetConsumer");
        consumerStore.setConsumerSecret(CONSUMER_SECRET);
        consumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC);
        OAuthServiceProvider provider = new OAuthServiceProvider(null, null, null);

        expect(consumerStoreService.findByUriAndServiceName(GADGET_URI, SERVICE_NAME))
                .andReturn(consumerStore);
        replay(consumerStoreService);
View Full Code Here

   * @return OAuthService instance.
   */
  public static OAuthService newInstance(String userRecordKey, String consumerKey,
      String consumerSecret, String requestTokenUrl, String authorizeUrl, String callbackUrl,
      String accessTokenUrl) {
    OAuthServiceProvider provider =
        new OAuthServiceProvider(requestTokenUrl, authorizeUrl, accessTokenUrl);
    OAuthConsumer consumer = new OAuthConsumer(callbackUrl, consumerKey, consumerSecret, provider);
    OAuthAccessor accessor = new OAuthAccessor(consumer);
    OAuthClient client = new OAuthClient(new OpenSocialHttpClient());
    PersistenceManagerFactory pmf = SingletonPersistenceManagerFactory.get();
    return new OAuthServiceImpl(accessor, client, pmf, userRecordKey);
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) {

    }
  }
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

  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

     */
    public GetOAuthConsumerByConsumerKeyExecution(final DomainMapper<String, OAuthConsumer> inMapper,
            final String inRequestTokenUrl, final String inAuthorizeUrl, final String inAccessTokenUrl)
    {
        mapper = inMapper;
        serviceProvider = new OAuthServiceProvider(inRequestTokenUrl, inAuthorizeUrl, inAccessTokenUrl);
    }
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.