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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    commence(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).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      commence in interface org.springframework.security.web.AuthenticationEntryPoint
      Throws:
      IOException
      jakarta.servlet.ServletException