* a 503/SERVICE UNAVAILABLE status back to the client.
*/
public boolean handleSecurity(HttpServletRequest request,
HttpServletResponse response) throws IOException {
SlingAuthenticator authenticator = slingAuthenticator;
if (authenticator != null) {
try {
// SLING-559: ensure correct parameter handling according to
// ParameterSupport
request = new HttpServletRequestWrapper(request) {
@Override
public String getParameter(String name) {
return getParameterSupport().getParameter(name);
}
@Override
public Map<String, String[]> getParameterMap() {
return getParameterSupport().getParameterMap();
}
@Override
public Enumeration<String> getParameterNames() {
return getParameterSupport().getParameterNames();
}
@Override
public String[] getParameterValues(String name) {
return getParameterSupport().getParameterValues(name);
}
private ParameterSupport getParameterSupport() {
return ParameterSupport.getInstance(getRequest());
}
};
return authenticator.authenticate(request, response);
} catch (MissingRepositoryException mre) {
log.error("handleSecurity: Cannot authenticate request: "
+ mre.getMessage());