Examples of retrieveAccessToken()


Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

                    // to the service provider and save those as well for later use.

                    // this is set only for OAuth 1.0a 
                    String verificationCode = request.getParameter(OAUTH_VERIFIER_PARAM);
                   
                    pp.retrieveAccessToken(consumer, verificationCode);

                    access_credentials = new Credentials(consumer.getToken(), consumer.getTokenSecret(), provider);

                    // no matter the result, we need to remove the request token
                    Credentials.deleteCredentials(request, response, provider, Credentials.Type.REQUEST);
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

        consumer.setTokenWithSecret(pinToken, pinTokenSecret);

        pinToken = null;
        pinTokenSecret = null;

        provider.retrieveAccessToken(consumer, pin);

        setAccessToken(consumer.getToken());
        setTokenSecret(consumer.getTokenSecret());
        setScreenName(provider.getResponseParameters().get("screen_name").first());
    }
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

    System.out.print("Enter your token: ");
    // read authorization code
    Scanner scanner = new Scanner(System.in);
    String authorizationCode = scanner.nextLine().trim();

    provider.retrieveAccessToken(consumer, authorizationCode);
       
    String accessToken = consumer.getToken();
    String tokenSecret = consumer.getTokenSecret();
    System.out.println("Token: " + accessToken + ". Secret: " + tokenSecret);
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

    OAuthConsumer consumer = (OAuthConsumer) request.getSession()
        .getAttribute(BODYMEDIA_OAUTH_CONSUMER);
    OAuthProvider provider = (OAuthProvider) request.getSession()
        .getAttribute(BODYMEDIA_OAUTH_PROVIDER);
    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();

        ApiKey apiKey;
        if (request.getParameter("apiKeyId")!=null) {
            long apiKeyId = Long.valueOf(request.getParameter("apiKeyId"));
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

                "https://api.bodymedia.com/oauth/request_token?api_key="+bodymediaConsumerKey,
                "https://api.bodymedia.com/oauth/access_token?api_key="+bodymediaConsumerKey,
                "https://api.bodymedia.com/oauth/authorize?api_key="+bodymediaConsumerKey, httpClient);

        try {
            provider.retrieveAccessToken(consumer, null);

            guestService.setApiKeyAttribute(updateInfo.apiKey,
                                            "accessToken", consumer.getToken());
            guestService.setApiKeyAttribute(updateInfo.apiKey,
                                            "tokenSecret", consumer.getTokenSecret());
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

  public String upgradeToken(HttpServletRequest request,
      HttpServletResponse response) throws OAuthException, OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException {
    OAuthConsumer consumer = (OAuthConsumer) request.getSession().getAttribute(FRESHBOOKS_OAUTH_CONSUMER);
    OAuthProvider provider = (OAuthProvider) request.getSession().getAttribute(FRESHBOOKS_OAUTH_PROVIDER);
    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();

        final Connector connector = Connector.getConnector("freshbooks");
        final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

  @RequestMapping(value="/upgradeToken")
  public String upgradeToken(HttpServletRequest request) throws OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException {
    OAuthConsumer consumer = (OAuthConsumer) request.getSession().getAttribute(LINKEDIN_OAUTH_CONSUMER);
    OAuthProvider provider = (OAuthProvider) request.getSession().getAttribute(LINKEDIN_OAUTH_PROVIDER);
    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();

        final Connector connector = Connector.getConnector("linkedin");
        final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

  public String upgradeToken(HttpServletRequest request,
      HttpServletResponse response) throws OAuthException, OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException {
    OAuthConsumer consumer = (OAuthConsumer) request.getSession().getAttribute(DROPBOX_OAUTH_CONSUMER);
    OAuthProvider provider = (OAuthProvider) request.getSession().getAttribute(DROPBOX_OAUTH_PROVIDER);
    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();
        final Connector connector = Connector.getConnector("dropbox");
        final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);

    guestService.setApiKeyAttribute(apiKey, "accessToken", consumer.getToken());
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

  public String upgradeToken(HttpServletRequest request,
      HttpServletResponse response) throws OAuthException, OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException {
    OAuthConsumer consumer = (OAuthConsumer) request.getSession().getAttribute(KHAN_OAUTH_CONSUMER);
    OAuthProvider provider = (OAuthProvider) request.getSession().getAttribute(KHAN_OAUTH_PROVIDER);
    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();

        final Connector connector = Connector.getConnector("khanacademy");
        final ApiKey apiKey = guestService.createApiKey(guest.getId(), connector);
View Full Code Here

Examples of oauth.signpost.OAuthProvider.retrieveAccessToken()

  @RequestMapping(value = "/upgradeToken")
  public String upgradeToken(HttpServletRequest request) throws OAuthException, OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException {
    OAuthConsumer consumer = (OAuthConsumer) request.getSession().getAttribute(TWITTER_OAUTH_CONSUMER);
    OAuthProvider provider = (OAuthProvider) request.getSession().getAttribute(TWITTER_OAUTH_PROVIDER);
    String verifier = request.getParameter("oauth_verifier");
    provider.retrieveAccessToken(consumer, verifier);
    Guest guest = AuthHelper.getGuest();

        final Connector connector = Connector.getConnector("twitter");
        ApiKey apiKey;
        if (request.getParameter("apiKeyId")!=null) {
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.