Package oauth.signpost.commonshttp

Examples of oauth.signpost.commonshttp.CommonsHttpOAuthProvider.retrieveRequestToken()


     *  This has to be done once to get request token
     */
    provider.setOAuth10a(true);
    // for some reason, SignPost does not append oauth_callback so I
    // added it directly into the AUTHORIZATION_URL
    String requestUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);
    System.out.println("Copy/Paste the following URL in your browser: " + requestUrl);
    System.out.print("Enter your token: ");
    // read authorization code
    Scanner scanner = new Scanner(System.in);
    String authorizationCode = scanner.nextLine().trim();
View Full Code Here


    request.getSession().setAttribute(BODYMEDIA_OAUTH_CONSUMER, consumer);
    request.getSession().setAttribute(BODYMEDIA_OAUTH_PROVIDER, provider);

        String approvalPageUrl = null;
        try {
            approvalPageUrl = provider.retrieveRequestToken(consumer,
                    oauthCallback);
        } catch (Throwable t) {
            logger.error("Couldn't retrieve BodyMedia request token.");
            t.printStackTrace();
            notificationsService.addNamedNotification(AuthHelper.getGuestId(),
View Full Code Here

       
    request.getSession().setAttribute(KHAN_OAUTH_CONSUMER, consumer);
    request.getSession().setAttribute(KHAN_OAUTH_PROVIDER, provider);

    try {
      provider.retrieveRequestToken(consumer, oauthCallback);
    } catch (Throwable e) {
      //TODO: a redirection happens here, and it should be handled
      System.out.println("redirection here");
    }
    System.out.println("the token secret is (musn't be null): " + consumer.getTokenSecret());
View Full Code Here

    request.getSession().setAttribute(TWITTER_OAUTH_PROVIDER, provider);
    System.out.println("the token secret is: " + consumer.getTokenSecret());
        if (request.getParameter("apiKeyId") != null)
            oauthCallback += "?apiKeyId=" + request.getParameter("apiKeyId");

    String approvalPageUrl = provider.retrieveRequestToken(consumer, oauthCallback);
   
    return "redirect:" + approvalPageUrl;
  }

  @RequestMapping(value = "/upgradeToken")
View Full Code Here

                "https://fireeagle.yahoo.net/oauth/authorize");

        System.out.println("Fetching request token from Fire Eagle...");

        // we do not support callbacks, thus pass OOB
        String authUrl = provider.retrieveRequestToken(consumer, "http://www.example.com");

        System.out.println("Request token: " + consumer.getToken());
        System.out.println("Token secret: " + consumer.getTokenSecret());

        System.out.println("Now visit:\n" + authUrl + "\n... and grant this app authorization");
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.