Examples of signRequest()


Examples of org.scribe.oauth.OAuthService.signRequest()

            logger.info("Getting protected resource");
            logger.info("Protected resource url: " + protectedResourceUrl);
            try
            {
                OAuthRequest request = new OAuthRequest(Verb.GET,protectedResourceUrl);
                service.signRequest(accessToken,request);
               
                Response response = request.send();
                logger.info("Status code: " + response.getCode());
                logger.info("Body: " + response.getBody());
               
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

          final String code = request.getParameter("code");
          if(StringUtils.isNotEmpty(code)){
            Verifier verifier = new Verifier(code);
            Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifier);
            OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, LIVE_ME_URL);
              service.signRequest(accessToken, oauthRequest);
              Response oauthResponse = oauthRequest.send();
              int responseCode = oauthResponse.getCode();
              String responseBody = oauthResponse.getBody();
             
              if(responseCode == 200){
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

            Verifier verifier = new Verifier(code);
            Token requestToken = (Token) request.getSession().getAttribute(TWITTER_OAUTH_REQUEST_TOKEN);
           
            Token accessToken = service.getAccessToken(requestToken, verifier);
            OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, TWITTER_URL);
              service.signRequest(accessToken, oauthRequest);
              Response oauthResponse = oauthRequest.send();
              int responseCode = oauthResponse.getCode();
              String responseBody = oauthResponse.getBody();
             
              if(responseCode == 200){
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

                    final String code = request.getParameter("code");
                    if (StringUtils.isNotEmpty(code)) {
                        Verifier verifier = new Verifier(code);
                        Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifier);
                        OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, GOOGLE_ME_URL);
                        service.signRequest(accessToken, oauthRequest);
                        Response oauthResponse = oauthRequest.send();
                        int responseCode = oauthResponse.getCode();
                        String responseBody = oauthResponse.getBody();

                        if (responseCode == 200) {
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

          final String code = request.getParameter("code");
          if(StringUtils.isNotEmpty(code)){
            Verifier verifier = new Verifier(code);
            Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifier);
            OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, FACEBOOK_ME_URL);
              service.signRequest(accessToken, oauthRequest);
              Response oauthResponse = oauthRequest.send();
              int responseCode = oauthResponse.getCode();
              String responseBody = oauthResponse.getBody();
             
              if(responseCode == 200){
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

        final Token token = new Token(accessToken, guestService.getApiKeyAttribute(updateInfo.apiKey, "runkeeperConsumerSecret"));
        final String userEndpoint = url + accessToken;
        OAuthRequest request = new OAuthRequest(Verb.GET, userEndpoint);
        request.addHeader("Accept", "application/vnd.com.runkeeper.User+json");
        final OAuthService service = runKeeperController.getOAuthService();
        service.signRequest(token, request);
        Response response = request.send();
        final int httpResponseCode = response.getCode();
        long then = System.currentTimeMillis();
        String body = response.getBody();
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

                                                parameters.get(parameterName));
            }
            OAuthService service = getOAuthService(updateInfo.apiKey);
            final String accessToken = guestService.getApiKeyAttribute(updateInfo.apiKey, "accessToken");
            final Token token = new Token(accessToken, guestService.getApiKeyAttribute(updateInfo.apiKey, "tokenSecret"));
            service.signRequest(token, request);
            Response response = request.send();
            httpResponseCode = response.getCode();
            if (httpResponseCode!=200)
                throw new UpdateFailedException("Unexpected response code: " + httpResponseCode);
            String json = response.getBody();
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

        System.out.println("********A basic user profile call********");
        //The ~ means yourself - so this should return the basic default information for your profile in XML format
        //https://developer.linkedin.com/documents/profile-api
        String url = "http://api.linkedin.com/v1/people/~";
        OAuthRequest request = new OAuthRequest(Verb.GET, url);
        service.signRequest(accessToken, request);
        Response response = request.send();
        System.out.println(response.getBody());
        System.out.println();System.out.println();

        System.out.println("********Get the profile in JSON********");
 
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

        //This basic call profile in JSON format
        //You can read more about JSON here http://json.org
        url = "http://api.linkedin.com/v1/people/~";
        request = new OAuthRequest(Verb.GET, url);
        request.addHeader("x-li-format", "json");
        service.signRequest(accessToken, request);
        response = request.send();
        System.out.println(response.getBody());
        System.out.println();System.out.println();

        System.out.println("********Get the profile in JSON using query parameter********");
 
View Full Code Here

Examples of org.scribe.oauth.OAuthService.signRequest()

        //This basic call profile in JSON format. Please note the call above is the preferred method.
        //You can read more about JSON here http://json.org
        url = "http://api.linkedin.com/v1/people/~";
        request = new OAuthRequest(Verb.GET, url);
        request.addQuerystringParameter("format", "json");
        service.signRequest(accessToken, request);
        response = request.send();
        System.out.println(response.getBody());
        System.out.println();System.out.println();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.