Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed after merging

  • Loading branch information...
commit 6e6bb56494b95fab196251ecf4ac398f88dbc10a 1 parent 9533974
@sfussenegger sfussenegger authored
View
13 ...c/main/java/org/springframework/social/security/provider/OAuth1AuthenticationService.java
@@ -80,9 +80,16 @@ public SocialAuthenticationToken getAuthToken(AuthenticationMode authMode, HttpS
request.getSession().setAttribute(OAUTH_TOKEN_ATTRIBUTE, requestToken);
// Redirect to the service provider for authorization
- String oAuthUrl = ops.buildAuthenticateUrl(requestToken.getValue(),
- ops.getVersion() == OAuth1Version.CORE_10 ? new OAuth1Parameters(returnToUrl)
- : OAuth1Parameters.NONE);
+ OAuth1Parameters params;
+ if (ops.getVersion() == OAuth1Version.CORE_10) {
+ params = new OAuth1Parameters();
+ params.setCallbackUrl(returnToUrl);
+ } else {
+ params = OAuth1Parameters.NONE;
+ }
+
+ String oAuthUrl = ops.buildAuthenticateUrl(requestToken.getValue(), params);
+
throw new SocialAuthenticationRedirectException(oAuthUrl);
} else {
// Second phase: request an access token
View
5 ...c/main/java/org/springframework/social/security/provider/OAuth2AuthenticationService.java
@@ -70,8 +70,11 @@ public SocialAuthenticationToken getAuthToken(AuthenticationMode authMode, HttpS
// First phase: get a request token
String returnToUrl = buildReturnToUrl(request);
String scope = getScope(); // TODO set scope
+ OAuth2Parameters params = new OAuth2Parameters();
+ params.setRedirectUri(returnToUrl);
+ params.setScope(scope);
String redirect = getConnectionFactory().getOAuthOperations().buildAuthenticateUrl(
- GrantType.AUTHORIZATION_CODE, new OAuth2Parameters(returnToUrl, scope));
+ GrantType.AUTHORIZATION_CODE, params);
throw new SocialAuthenticationRedirectException(redirect);
} else if (StringUtils.hasText(code)) {
try {
View
10 ...ng-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java
@@ -301,16 +301,6 @@ private void setNoCache(NativeWebRequest request) {
}
}
- private void setNoCache(NativeWebRequest request) {
- HttpServletResponse response = request.getNativeResponse(HttpServletResponse.class);
- if (response != null) {
- response.setHeader("Pragma", "no-cache");
- response.setDateHeader("Expires", 1L);
- response.setHeader("Cache-Control", "no-cache");
- response.addHeader("Cache-Control", "no-store");
- }
- }
-
private static final String DUPLICATE_CONNECTION_ATTRIBUTE = "social.addConnection.duplicate";
}
Please sign in to comment.
Something went wrong with that request. Please try again.