Package waffle.spring
Class NegotiateSecurityFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
waffle.spring.NegotiateSecurityFilter
- 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
- Direct Known Subclasses:
DelegatingNegotiateSecurityFilter
public class NegotiateSecurityFilter
extends org.springframework.web.filter.GenericFilterBean
A Spring Negotiate security filter.
-
Field Summary
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
doFilter
(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) org.springframework.security.core.GrantedAuthority
Gets the default granted authority.Gets the granted authority factory.Gets the principal format.Gets the provider.Gets the role format.boolean
Checks if is allow guest login.boolean
Checks if is impersonate.protected void
sendUnauthorized
(javax.servlet.http.HttpServletResponse response, boolean close) Send a 401 Unauthorized along with protocol authentication headers.void
setAllowGuestLogin
(boolean value) Sets the allow guest login.protected boolean
setAuthentication
(javax.servlet.http.HttpServletRequest request, javax.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.void
setDefaultGrantedAuthority
(org.springframework.security.core.GrantedAuthority value) Sets the default granted authority.void
Sets the granted authority factory.void
setImpersonate
(boolean value) Enable/Disable impersonation.void
setPrincipalFormat
(String value) Sets the principal format.void
Sets the principal format enum.void
Sets the provider.void
setRoleFormat
(String value) Sets the role format.void
setRoleFormatEnum
(PrincipalFormat value) Sets the role format enum.Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.servlet.Filter
doFilter
-
Constructor Details
-
NegotiateSecurityFilter
public NegotiateSecurityFilter()Instantiates a new negotiate security filter.
-
-
Method Details
-
doFilter
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Throws:
IOException
javax.servlet.ServletException
-
setAuthentication
protected boolean setAuthentication(javax.servlet.http.HttpServletRequest request, javax.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.- Parameters:
request
- the requestresponse
- the responseauthentication
- the authentication- Returns:
- true, if successful
-
afterPropertiesSet
public void afterPropertiesSet() throws javax.servlet.ServletException- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.web.filter.GenericFilterBean
- Throws:
javax.servlet.ServletException
-
sendUnauthorized
protected void sendUnauthorized(javax.servlet.http.HttpServletResponse response, boolean close) Send a 401 Unauthorized along with protocol authentication headers.- Parameters:
response
- HTTP Responseclose
- Close connection.
-
getPrincipalFormat
Gets the principal format.- Returns:
- the principal format
-
setPrincipalFormatEnum
Sets the principal format enum.- Parameters:
value
- the new principal format enum
-
setPrincipalFormat
Sets the principal format.- Parameters:
value
- the new principal format
-
getRoleFormat
Gets the role format.- Returns:
- the role format
-
setRoleFormatEnum
Sets the role format enum.- Parameters:
value
- the new role format enum
-
setRoleFormat
Sets the role format.- Parameters:
value
- the new role format
-
isAllowGuestLogin
public boolean isAllowGuestLogin()Checks if is allow guest login.- Returns:
- true, if is allow guest login
-
setAllowGuestLogin
public void setAllowGuestLogin(boolean value) Sets the allow guest login.- Parameters:
value
- the new allow guest login
-
setImpersonate
public void setImpersonate(boolean value) Enable/Disable impersonation.- Parameters:
value
- true to enable impersonation, false otherwise
-
isImpersonate
public boolean isImpersonate()Checks if is impersonate.- Returns:
- true if impersonation is enabled, false otherwise
-
getProvider
Gets the provider.- Returns:
- the provider
-
setProvider
Sets the provider.- Parameters:
value
- the new provider
-
getGrantedAuthorityFactory
Gets the granted authority factory.- Returns:
- the granted authority factory
-
setGrantedAuthorityFactory
Sets the granted authority factory.- Parameters:
value
- the new granted authority factory
-
getDefaultGrantedAuthority
public org.springframework.security.core.GrantedAuthority getDefaultGrantedAuthority()Gets the default granted authority.- Returns:
- the default granted authority
-
setDefaultGrantedAuthority
public void setDefaultGrantedAuthority(org.springframework.security.core.GrantedAuthority value) Sets the default granted authority.- Parameters:
value
- the new default granted authority
-