Class AuthEntryPointJwt
java.lang.Object
it.unicam.cs.ids2425.FilieraAgricola.security.AuthEntryPointJwt
- All Implemented Interfaces:
org.springframework.security.web.AuthenticationEntryPoint
@Component
public class AuthEntryPointJwt
extends Object
implements org.springframework.security.web.AuthenticationEntryPoint
Gestisce i tentativi di accesso non autorizzato intercettando le eccezioni di autenticazione.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) Viene invocato quando un utente non autenticato tenta di accedere a una risorsa protetta, restituendo un errore HTTP 401 (Unauthorized).
-
Constructor Details
-
AuthEntryPointJwt
public AuthEntryPointJwt()
-
-
Method Details
-
commence
public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authException) throws IOException, jakarta.servlet.ServletException Viene invocato quando un utente non autenticato tenta di accedere a una risorsa protetta, restituendo un errore HTTP 401 (Unauthorized).- Specified by:
commencein interfaceorg.springframework.security.web.AuthenticationEntryPoint- Throws:
IOExceptionjakarta.servlet.ServletException
-