java.lang.Object
org.springframework.web.filter.GenericFilterBean
waffle.spring.NegotiateSecurityFilter
waffle.spring.DelegatingNegotiateSecurityFilter
- All Implemented Interfaces:
jakarta.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
Supports optional injection of spring security entities, allowing Waffle to act as an interface towards an identity
provider(the AD).
Below mentioned entities are verified to be set before invoked, inherited entities are not.
- The
AuthenticationManagerallows for the service provider to authorize the principal. - The
authenticationSuccessHandlerallows for the service provider to further populate theAuthenticationobject. - The
AuthenticationFailureHandleris called if the AuthenticationManager throws anAuthenticationException. - The
AccessDeniedHandleris called if the AuthenticationManager throws anAccessDeniedException.
<bean id="waffleNegotiateSecurityFilter"
class="waffle.spring.DelegatingNegotiateSecurityFilter"
scope="tenant">
<property name="allowGuestLogin" value="false" />
<property name="Provider" ref="waffleSecurityFilterProviderCollection" />
<property name="authenticationManager" ref="authenticationManager" />
<property name="authenticationSuccessHandler" ref="authenticationSuccessHandler" />
<property name="authenticationFailureHandler" ref="authenticationFailureHandler" />
<property name="accessDeniedHandler" ref="accessDeniedHandler" />
<property name="defaultGrantedAuthority">
<null />
</property>
</bean>
-
Field Summary
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new delegating negotiate security filter. -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.springframework.security.web.access.AccessDeniedHandlerGets the access denied handler.org.springframework.security.web.authentication.AuthenticationFailureHandlerGets the authentication failure handler.org.springframework.security.authentication.AuthenticationManagerGets the authentication manager.org.springframework.security.web.authentication.AuthenticationSuccessHandlerGets the authentication success handler.voidsetAccessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler value) Sets the access denied handler.protected booleansetAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) Invoked when authentication towards ad was succesful to populate securitycontext Override to add service provider authorization checks.voidsetAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler value) Sets the authentication failure handler.voidsetAuthenticationManager(org.springframework.security.authentication.AuthenticationManager value) Sets the authentication manager.voidsetAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler value) Sets the authentication success handler.Methods inherited from class waffle.spring.NegotiateSecurityFilter
doFilter, getDefaultGrantedAuthority, getGrantedAuthorityFactory, getPrincipalFormat, getProvider, getRoleFormat, isAllowGuestLogin, isImpersonate, sendUnauthorized, setAllowGuestLogin, setDefaultGrantedAuthority, setGrantedAuthorityFactory, setImpersonate, setPrincipalFormat, setPrincipalFormatEnum, setProvider, setRoleFormat, setRoleFormatEnumMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
DelegatingNegotiateSecurityFilter
public DelegatingNegotiateSecurityFilter()Instantiates a new delegating negotiate security filter.
-
-
Method Details
-
getAccessDeniedHandler
public org.springframework.security.web.access.AccessDeniedHandler getAccessDeniedHandler()Gets the access denied handler.- Returns:
- the accessDeniedHandler
-
setAccessDeniedHandler
public void setAccessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler value) Sets the access denied handler.- Parameters:
value- the accessDeniedHandler to set
-
getAuthenticationFailureHandler
public org.springframework.security.web.authentication.AuthenticationFailureHandler getAuthenticationFailureHandler()Gets the authentication failure handler.- Returns:
- the authenticationFailureHandler
-
setAuthenticationFailureHandler
public void setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler value) Sets the authentication failure handler.- Parameters:
value- the authenticationFailureHandler to set
-
setAuthentication
protected boolean setAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) Description copied from class:NegotiateSecurityFilterInvoked when authentication towards ad was succesful to populate securitycontext Override to add service provider authorization checks.- Overrides:
setAuthenticationin classNegotiateSecurityFilter- Parameters:
request- the requestresponse- the responseauthentication- the authentication- Returns:
- true, if successful
-
afterPropertiesSet
public void afterPropertiesSet() throws jakarta.servlet.ServletException- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classNegotiateSecurityFilter- Throws:
jakarta.servlet.ServletException
-
getAuthenticationSuccessHandler
public org.springframework.security.web.authentication.AuthenticationSuccessHandler getAuthenticationSuccessHandler()Gets the authentication success handler.- Returns:
- the authenticationSuccessHandler
-
setAuthenticationSuccessHandler
public void setAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler value) Sets the authentication success handler.- Parameters:
value- the authenticationSuccessHandler to set
-
getAuthenticationManager
public org.springframework.security.authentication.AuthenticationManager getAuthenticationManager()Gets the authentication manager.- Returns:
- the authenticationManager
-
setAuthenticationManager
public void setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager value) Sets the authentication manager.- Parameters:
value- the authenticationManager to set
-