Package net.oauth

Examples of net.oauth.OAuthAccessor


    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);
     return OAuth.addParameters(message.URL, message.getParameters());
View Full Code Here

   }
  
   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);
     message.addRequiredParameters(accessor);
View Full Code Here

   }

   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);
     return OAuth.addParameters(message.URL, message.getParameters());
View Full Code Here

    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

    while (it.hasNext()) {
      Map.Entry p = (Map.Entry) it.next();
      params.add(new OAuth.Parameter((String) p.getKey(), (String) p
          .getValue()));
    }
    OAuthAccessor accessor = createOAuthAccessor();
    accessor.tokenSecret = props.getProperty("tokenSecret");
    OAuthClient client = new OAuthClient(
        new HttpClient4(new SingleClient()));
    return client.invoke(accessor, "GET", url, params);
  }
View Full Code Here

        .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);

    return message.getAuthorizationHeader(resource);
  }
View Full Code Here

    return message.getAuthorizationHeader(resource);
  }

  public void request() throws Exception {
    OAuthAccessor accessor = createOAuthAccessor();
    HttpClient4 httpClient = new HttpClient4(new SingleClient());
    OAuthClient client = new OAuthClient(httpClient);
    client.getRequestToken(accessor);
    props.setProperty("requestToken", accessor.requestToken);
    props.setProperty("tokenSecret", accessor.tokenSecret);
View Full Code Here

    Properties paramProps = new Properties();
    paramProps
        .setProperty("application_name", props.getProperty("appName"));
    paramProps
        .setProperty("oauth_token", props.getProperty("requestToken"));
    OAuthAccessor accessor = createOAuthAccessor();
    OAuthMessage response = sendRequest(paramProps,
        accessor.consumer.serviceProvider.userAuthorizationURL);
    return response.URL;
  }
View Full Code Here

            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
        validator.validateMessage(message, accessor, accessToken);
View Full Code Here

TOP

Related Classes of net.oauth.OAuthAccessor

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.