Class AuthenticationEntryPoint

java.lang.Object
org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
springboot.bg.harisauto.common.config.swagger.AuthenticationEntryPoint
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.security.web.AuthenticationEntryPoint

@Component public class AuthenticationEntryPoint extends org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
AuthenticationEntryPoint.java - Custom authentication entry point for handling unauthorized access.
Author:
Kristian Popov
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the realm name.
    void
    commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authEx)
    Begins an authentication scheme.

    Methods inherited from class org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint

    getRealmName, setRealmName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AuthenticationEntryPoint

      public AuthenticationEntryPoint()
  • Method Details

    • commence

      public void commence(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException authEx) throws IOException
      Begins an authentication scheme.
      Specified by:
      commence in interface org.springframework.security.web.AuthenticationEntryPoint
      Overrides:
      commence in class org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
      Parameters:
      request - that resulted in an AuthenticationException
      response - so that the user agent can begin authentication
      authEx - that caused the invocation
      Throws:
      IOException - if an I/O error occurs during processing
    • afterPropertiesSet

      public void afterPropertiesSet()
      Sets the realm name.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint