1 |
59960
|
k.triantaf
|
package eu.dnetlib.uoaauthorizationlibrary.security;
|
2 |
|
|
|
3 |
|
|
import org.springframework.security.core.AuthenticationException;
|
4 |
|
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
5 |
|
|
|
6 |
|
|
import javax.servlet.http.HttpServletRequest;
|
7 |
|
|
import javax.servlet.http.HttpServletResponse;
|
8 |
|
|
import java.io.IOException;
|
9 |
|
|
|
10 |
|
|
public class EntryPoint implements AuthenticationEntryPoint {
|
11 |
|
|
|
12 |
|
|
@Override
|
13 |
|
|
public void commence(HttpServletRequest request, HttpServletResponse response,
|
14 |
|
|
AuthenticationException authException) throws IOException {
|
15 |
|
|
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.getMessage());
|
16 |
|
|
}
|
17 |
|
|
|
18 |
|
|
}
|