Examples of fetchRequestToken()


Examples of org.springframework.social.oauth1.OAuth1Operations.fetchRequestToken()

    when(factory.getProviderId()).thenReturn(connection.getKey().getProviderId());
    when(factory.getOAuthOperations()).thenReturn(operations);
    when(factory.createConnection(ArgMatchers.oAuthToken(oAuthToken))).thenReturn(connection);
   
    when(operations.getVersion()).thenReturn(OAuth1Version.CORE_10_REVISION_A);
    when(operations.fetchRequestToken("http://"+serverName+"/auth/foo?param=param_value", null)).thenReturn(oAuthToken);
    when(operations.exchangeForAccessToken(ArgMatchers.authorizedRequestToken(oAuthToken, verifier), Matchers.same((MultiValueMap<String, String>) null))).thenReturn(oAuthToken);
    when(operations.buildAuthenticateUrl(oAuthToken.getValue(), OAuth1Parameters.NONE)).thenReturn(serviceUrl + "?oauth_token=" + oAuthToken.getValue());
   
    // first phase
    MockHttpServletRequest request = new MockHttpServletRequest(context, "GET", "/auth/foo");
View Full Code Here

Examples of org.springframework.social.oauth1.OAuth1Operations.fetchRequestToken()

    String verifier = request.getParameter("oauth_verifier");
    if (!StringUtils.hasText(verifier)) {
      // First phase: get a request token
      OAuth1Operations ops = getConnectionFactory().getOAuthOperations();
      String returnToUrl = buildReturnToUrl(request);
      OAuthToken requestToken = ops.fetchRequestToken(returnToUrl, null);
      request.getSession().setAttribute(OAUTH_TOKEN_ATTRIBUTE, requestToken);

      // Redirect to the service provider for authorization
      OAuth1Parameters params;
      if (ops.getVersion() == OAuth1Version.CORE_10) {
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.