Package net.oauth

Examples of net.oauth.OAuthConsumer


    @SuppressWarnings("unchecked")
    private String getPushMessageURL(String callbackURI, String messageSenderId)
       throws Exception {
       OAuthMessage message = new OAuthMessage("POST", callbackURI, Collections.<Map.Entry>emptyList());
       OAuthConsumer consumer = new OAuthConsumer(null, messageSenderId,
            getConsumerSecret(messageSenderId), null);
       OAuthAccessor accessor = new OAuthAccessor(consumer);
       message.addRequiredParameters(accessor);
       return OAuth.addParameters(message.URL, message.getParameters());
    }
View Full Code Here


  

   private String getRequestURL(String consumerKey, String consumerSecret,
                                String callbackURI, String scope, String permission) throws Exception {
     OAuthMessage message = new OAuthMessage("GET", RequestTokenURL, Collections.<Map.Entry>emptyList());
     OAuthConsumer consumer = new OAuthConsumer(callbackURI, consumerKey, consumerSecret, null);
     OAuthAccessor accessor = new OAuthAccessor(consumer);
     message.addParameter(OAuth.OAUTH_CALLBACK, consumer.callbackURL);
     message.addParameter("xoauth_scope", scope);
     message.addParameter("xoauth_permission", permission);
     message.addRequiredParameters(accessor);
View Full Code Here

       return OAuth.addParameters(TokenAuthorizationURL, parameters);
   }
  
   private String getAccessURL(String consumerKey, String consumerSecret, String requestKey, String requestSecret, String verifier) throws Exception {
     OAuthMessage message = new OAuthMessage("GET", AccessTokenURL, Collections.<Map.Entry>emptyList());
     OAuthConsumer consumer = new OAuthConsumer("http://callback.net", consumerKey, consumerSecret, null);
     OAuthAccessor accessor = new OAuthAccessor(consumer);
     accessor.requestToken = requestKey;
     accessor.tokenSecret = requestSecret;
     message.addParameter(OAuthUtils.OAUTH_VERIFIER_PARAM, verifier);
     message.addParameter(OAuth.OAUTH_TOKEN, requestKey);
View Full Code Here

     return OAuth.addParameters(message.URL, message.getParameters());
   }

   private String getEndUserURL(String url, String consumerKey, String consumerSecret, String accessKey, String accessSecret) throws Exception {
     OAuthMessage message = new OAuthMessage("GET", endUserScope + url, Collections.<Map.Entry>emptyList());
     OAuthConsumer consumer = new OAuthConsumer("http://callback.net", consumerKey, consumerSecret, null);
     OAuthAccessor accessor = new OAuthAccessor(consumer);
     accessor.accessToken = accessKey;
     accessor.tokenSecret = accessSecret;
     message.addParameter(OAuth.OAUTH_TOKEN, accessKey);
     message.addRequiredParameters(accessor);
View Full Code Here

    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

    OAuthServiceProvider provider = new OAuthServiceProvider(props
        .getProperty("requestUrl"), props
        .getProperty("authorizationUrl"), props
        .getProperty("accessUrl"));
    OAuthConsumer consumer = new OAuthConsumer("", props
        .getProperty("consumerKey"), props
        .getProperty("consumerSecret"), provider);
    OAuthAccessor accessor = new OAuthAccessor(consumer);
    accessor.tokenSecret = props.getProperty("tokenSecret");
    message.sign(accessor);
View Full Code Here

            OAuthMessage message,
            OAuthToken accessToken,
            OAuthValidator validator,
            org.jboss.resteasy.auth.oauth.OAuthConsumer consumer) throws Exception {
     
        OAuthConsumer _consumer = new OAuthConsumer(null, consumer.getKey(), accessToken.getConsumer().getSecret(), null);
        OAuthAccessor accessor = new OAuthAccessor(_consumer);
        accessor.accessToken = accessToken.getToken();
        accessor.tokenSecret = accessToken.getSecret();
       
        // validate the message
View Full Code Here

      String[] scopes = consumer.getScopes();
        if (scopes == null || !validateUriScopes(request.getRequestURL().toString(), scopes)) {
            throw new OAuthException(HttpURLConnection.HTTP_BAD_REQUEST, "Wrong URI Scope");
        }
        // build some info for verification
        OAuthConsumer _consumer = new OAuthConsumer(null, consumer.getKey(), consumer.getSecret(), null);
        OAuthAccessor accessor = new OAuthAccessor(_consumer);
        // validate the message
        validator.validateMessage(message, accessor, null);
  }
View Full Code Here

      String consumerKey = message.getParameter(OAuth.OAUTH_CONSUMER_KEY);
      // load the OAuth Consumer
      org.jboss.resteasy.auth.oauth.OAuthConsumer consumer = provider.getConsumer(consumerKey);
     
      // create some structures for net.oauth
      OAuthConsumer _consumer = new OAuthConsumer(null, consumerKey, consumer.getSecret(), null);
      OAuthAccessor accessor = new OAuthAccessor(_consumer);
     
      // validate the message
      validator.validateMessage(message, accessor, null);
View Full Code Here

     
      // get the Request Token to exchange
      OAuthToken requestToken = provider.getRequestToken(consumerKey, requestTokenString);
     
      // build some structures for net.oauth
      OAuthConsumer consumer = new OAuthConsumer(null, consumerKey, requestToken.getConsumer().getSecret(), null);
      OAuthAccessor accessor = new OAuthAccessor(consumer);
      accessor.requestToken = requestTokenString;
      accessor.tokenSecret = requestToken.getSecret();

      // verify the message signature
View Full Code Here

TOP

Related Classes of net.oauth.OAuthConsumer

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.