diff options
author | Vitaly Takmazov | 2017-01-19 23:11:46 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-01-19 23:11:46 +0300 |
commit | 0736bfd7a02c1c3991be475fae5f70607bf3070f (patch) | |
tree | aad3eda7848cb4fb292bbaad23bb18d1764d5cfd | |
parent | ed993af2e0e95b9af8c949fc0a5c812e93731c14 (diff) |
juick-api: unauthorized response must be 401
-rw-r--r-- | juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java | 6 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/security/NotAuthorizedAuthenticationEntryPoint.java (renamed from juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java) | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java index 2d3540ab..48d79e27 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java @@ -1,6 +1,6 @@ package com.juick.api.configuration; -import com.juick.server.security.ForbiddenStatusAuthenticationEntryPoint; +import com.juick.server.security.NotAuthorizedAuthenticationEntryPoint; import com.juick.service.UserService; import com.juick.service.security.JuickUserDetailsService; import com.juick.service.security.deprecated.RequestParamHashRememberMeServices; @@ -82,8 +82,8 @@ public class ApiSecurityConfig extends WebSecurityConfigurerAdapter { } @Bean - public ForbiddenStatusAuthenticationEntryPoint getJuickAuthenticationEntryPoint() { - return new ForbiddenStatusAuthenticationEntryPoint(); + public NotAuthorizedAuthenticationEntryPoint getJuickAuthenticationEntryPoint() { + return new NotAuthorizedAuthenticationEntryPoint(); } @Bean diff --git a/juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java b/juick-server/src/main/java/com/juick/server/security/NotAuthorizedAuthenticationEntryPoint.java index 92b206dd..d9dc6d61 100644 --- a/juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java +++ b/juick-server/src/main/java/com/juick/server/security/NotAuthorizedAuthenticationEntryPoint.java @@ -11,10 +11,10 @@ import java.io.IOException; /** * Created by vitalyster on 25.11.2016. */ -public class ForbiddenStatusAuthenticationEntryPoint implements AuthenticationEntryPoint { +public class NotAuthorizedAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { - response.setStatus(HttpServletResponse.SC_FORBIDDEN); + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); } } |