コード例 #1
0
 private String buildOAuth1Url(
     OAuth1Operations oauthOperations, String requestToken, OAuth1Parameters parameters) {
   if (useAuthenticateUrl) {
     return oauthOperations.buildAuthenticateUrl(requestToken, parameters);
   } else {
     return oauthOperations.buildAuthorizeUrl(requestToken, parameters);
   }
 }
コード例 #2
0
 private String buildOAuth1Url(
     OAuth1ConnectionFactory<?> connectionFactory,
     NativeWebRequest request,
     MultiValueMap<String, String> additionalParameters) {
   OAuth1Operations oauthOperations = connectionFactory.getOAuthOperations();
   OAuth1Parameters parameters = new OAuth1Parameters(additionalParameters);
   if (oauthOperations.getVersion() == OAuth1Version.CORE_10) {
     parameters.setCallbackUrl(callbackUrl(request));
   }
   OAuthToken requestToken = fetchRequestToken(request, oauthOperations);
   request.setAttribute(OAUTH_TOKEN_ATTRIBUTE, requestToken, RequestAttributes.SCOPE_SESSION);
   return buildOAuth1Url(oauthOperations, requestToken.getValue(), parameters);
 }
コード例 #3
0
 private OAuthToken fetchRequestToken(NativeWebRequest request, OAuth1Operations oauthOperations) {
   if (oauthOperations.getVersion() == OAuth1Version.CORE_10_REVISION_A) {
     return oauthOperations.fetchRequestToken(callbackUrl(request), null);
   }
   return oauthOperations.fetchRequestToken(null, null);
 }