|
@@ -22,6 +22,7 @@ import javax.servlet.ServletException;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.security.core.AuthenticationException;
|
|
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
@@ -57,8 +58,7 @@ public class BasicAuthenticationEntryPoint implements AuthenticationEntryPoint,
|
|
|
public void commence(HttpServletRequest request, HttpServletResponse response,
|
|
|
AuthenticationException authException) throws IOException, ServletException {
|
|
|
response.addHeader("WWW-Authenticate", "Basic realm=\"" + realmName + "\"");
|
|
|
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED,
|
|
|
- authException.getMessage());
|
|
|
+ response.sendError(HttpStatus.UNAUTHORIZED.value(), HttpStatus.UNAUTHORIZED.getReasonPhrase());
|
|
|
}
|
|
|
|
|
|
public String getRealmName() {
|