Encode redirect URL before send it to AAI
This commit is contained in:
parent
8dbe961d55
commit
6e575ed4a6
|
@ -10,6 +10,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Configuration
|
||||
public class OpenAIRELogoutSuccessHandler implements LogoutSuccessHandler {
|
||||
|
@ -21,6 +24,10 @@ public class OpenAIRELogoutSuccessHandler implements LogoutSuccessHandler {
|
|||
this.properties = properties;
|
||||
}
|
||||
|
||||
private String encodeValue(String value) throws UnsupportedEncodingException {
|
||||
return URLEncoder.encode(value, StandardCharsets.UTF_8.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
|
||||
HttpSession session = request.getSession();
|
||||
|
@ -30,6 +37,6 @@ public class OpenAIRELogoutSuccessHandler implements LogoutSuccessHandler {
|
|||
redirect = properties.getRedirect();
|
||||
}
|
||||
session.invalidate();
|
||||
response.sendRedirect(properties.getOidc().getLogout() + redirect);
|
||||
response.sendRedirect(properties.getOidc().getLogout() + encodeValue(redirect));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue