unicon.matthews.security.RestAuthenticationEntryPoint   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 10
eloc 6
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A commence(HttpServletRequest,HttpServletResponse,AuthenticationException) 0 4 1
1
package unicon.matthews.security;
2
3
import java.io.IOException;
4
5
import javax.servlet.ServletException;
6
import javax.servlet.http.HttpServletRequest;
7
import javax.servlet.http.HttpServletResponse;
8
9
import org.springframework.http.HttpStatus;
10
import org.springframework.security.core.AuthenticationException;
11
import org.springframework.security.web.AuthenticationEntryPoint;
12
import org.springframework.stereotype.Component;
13
14
/**
15
 * 
16
 * @author vladimir.stankovic
17
 *
18
 * Aug 4, 2016
19
 */
20
@Component
21
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
22
	@Override
23
	public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException ex)
24
			throws IOException, ServletException {
25
		response.sendError(HttpStatus.UNAUTHORIZED.value(), "Unauthorized");
26
	}
27
}
28