Examples of AuthorizedRequestToken


Examples of org.springframework.social.oauth1.AuthorizedRequestToken

   * @param request the current web request
   * @return a new connection to the service provider
   */
  public Connection<?> completeConnection(OAuth1ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
    String verifier = request.getParameter("oauth_verifier");
    AuthorizedRequestToken requestToken = new AuthorizedRequestToken(extractCachedRequestToken(request), verifier);
    OAuthToken accessToken = connectionFactory.getOAuthOperations().exchangeForAccessToken(requestToken, null);
    return connectionFactory.createConnection(accessToken);
  }
View Full Code Here

Examples of org.springframework.social.oauth1.AuthorizedRequestToken

      final String verifier) {
    return Matchers.argThat(new ArgumentMatcher<AuthorizedRequestToken>() {

      public boolean matches(Object item) {
        if (item instanceof AuthorizedRequestToken) {
          AuthorizedRequestToken token = (AuthorizedRequestToken) item;
          return eq(value, token.getValue()) && eq(secret, token.getSecret())
              && eq(verifier, token.getVerifier());
        }
        return false;
      }

    });
View Full Code Here

Examples of org.springframework.social.oauth1.AuthorizedRequestToken

      OAuthToken requestToken = extractCachedRequestToken(request);
      if (requestToken == null) {
        logger.warn("requestToken unavailable for oauth_verifier");
        return null;
      }
      OAuthToken accessToken = getConnectionFactory().getOAuthOperations().exchangeForAccessToken(new AuthorizedRequestToken(requestToken, verifier), null);
      // TODO avoid API call if possible (auth using token would be fine)
            Connection<S> connection = getConnectionFactory().createConnection(accessToken);
            return new SocialAuthenticationToken(connection, 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.