1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.spring.security;
20
21 import java.io.IOException;
22 import javax.servlet.http.HttpServletRequest;
23 import javax.servlet.http.HttpServletResponse;
24 import org.apache.syncope.common.rest.api.RESTHeaders;
25 import org.springframework.security.core.AuthenticationException;
26 import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
27
28
29
30
31 public class SyncopeBasicAuthenticationEntryPoint extends BasicAuthenticationEntryPoint {
32
33 @Override
34 public void commence(final HttpServletRequest request, final HttpServletResponse response,
35 final AuthenticationException authException) throws IOException {
36
37 response.addHeader(RESTHeaders.ERROR_INFO, authException.getMessage());
38
39 super.commence(request, response, authException);
40 }
41 }