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 -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the realm name.voidcommence(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
-
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:
commencein interfaceorg.springframework.security.web.AuthenticationEntryPoint- Overrides:
commencein classorg.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint- Parameters:
request- that resulted in anAuthenticationExceptionresponse- so that the user agent can begin authenticationauthEx- that caused the invocation- Throws:
IOException- if an I/O error occurs during processing
-
afterPropertiesSet
public void afterPropertiesSet()Sets the realm name.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint
-