From b1861f326a834865f1d700745dfb5f1b1596ba1f Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Sat, 10 Dec 2016 22:58:20 +0700 Subject: Api authorization entry point renamed --- .../ForbiddenStatusAuthenticationEntryPoint.java | 20 ++++++++++++++++++++ .../security/JuickAuthenticationEntryPoint.java | 20 -------------------- 2 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java delete mode 100644 juick-server/src/main/java/com/juick/server/security/JuickAuthenticationEntryPoint.java (limited to 'juick-server/src/main/java/com/juick/server/security') diff --git a/juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java b/juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java new file mode 100644 index 00000000..92b206dd --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/security/ForbiddenStatusAuthenticationEntryPoint.java @@ -0,0 +1,20 @@ +package com.juick.server.security; + +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.web.AuthenticationEntryPoint; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * Created by vitalyster on 25.11.2016. + */ +public class ForbiddenStatusAuthenticationEntryPoint implements AuthenticationEntryPoint { + @Override + public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) + throws IOException, ServletException { + response.setStatus(HttpServletResponse.SC_FORBIDDEN); + } +} diff --git a/juick-server/src/main/java/com/juick/server/security/JuickAuthenticationEntryPoint.java b/juick-server/src/main/java/com/juick/server/security/JuickAuthenticationEntryPoint.java deleted file mode 100644 index 4c73196d..00000000 --- a/juick-server/src/main/java/com/juick/server/security/JuickAuthenticationEntryPoint.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.juick.server.security; - -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.AuthenticationEntryPoint; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * Created by vitalyster on 25.11.2016. - */ -public class JuickAuthenticationEntryPoint implements AuthenticationEntryPoint { - @Override - public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) - throws IOException, ServletException { - response.setStatus(HttpServletResponse.SC_FORBIDDEN); - } -} -- cgit v1.2.3