Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private Authentication attemptAuthService(final SocialAuthenticationService<?> a
Authentication auth = getAuthentication();
// Check if not already authenticated or is already logged in anonymous.
if (auth == null || !auth.isAuthenticated() || authenticationTrustResolver.isAnonymous(auth)) {
return doAuthentication(authService, request, token);
return doAuthentication(authService, request, response, token);
} else {
addConnection(authService, request, token, auth);
return auth;
Expand Down Expand Up @@ -351,7 +351,7 @@ private void addConnection(final SocialAuthenticationService<?> authService, Htt
}
}

private Authentication doAuthentication(SocialAuthenticationService<?> authService, HttpServletRequest request, SocialAuthenticationToken token) {
private Authentication doAuthentication(SocialAuthenticationService<?> authService, HttpServletRequest request, HttpServletResponse response, SocialAuthenticationToken token) {
try {
if (!authService.getConnectionCardinality().isAuthenticatePossible()) return null;
token.setDetails(authenticationDetailsSource.buildDetails(request));
Expand All @@ -363,7 +363,7 @@ private Authentication doAuthentication(SocialAuthenticationService<?> authServi
// connection unknown, register new user?
if (signupUrl != null) {
// store ConnectionData in session and redirect to register page
sessionStrategy.setAttribute(new ServletWebRequest(request), ProviderSignInAttempt.SESSION_ATTRIBUTE, new ProviderSignInAttempt(token.getConnection()));
sessionStrategy.setAttribute(new ServletWebRequest(request, response), ProviderSignInAttempt.SESSION_ATTRIBUTE, new ProviderSignInAttempt(token.getConnection()));
throw new SocialAuthenticationRedirectException(buildSignupUrl(request));
}
throw e;
Expand Down