19 lines
686 B
Java
19 lines
686 B
Java
package com.rest.api.config.security;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.security.core.AuthenticationException;
|
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
|
|
@Slf4j
|
|
@Component
|
|
public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
|
@Override
|
|
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException ex) throws IOException {
|
|
response.sendRedirect("/exception/entrypoint");
|
|
}
|
|
} |