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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddoFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) org.springframework.security.core.GrantedAuthorityGets the default granted authority.Gets the granted authority factory.waffle.windows.auth.PrincipalFormatGets the principal format.waffle.servlet.spi.SecurityFilterProviderCollectionGets the provider.waffle.windows.auth.PrincipalFormatGets the role format.booleanChecks if is allow guest login.booleanChecks if is impersonate.protected voidsendUnauthorized(jakarta.servlet.http.HttpServletResponse response, boolean close) Send a 401 Unauthorized along with protocol authentication headers.voidsetAllowGuestLogin(boolean value) Sets the allow guest login.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.voidsetDefaultGrantedAuthority(org.springframework.security.core.GrantedAuthority value) Sets the default granted authority.voidSets the granted authority factory.voidsetImpersonate(boolean value) Enable/Disable impersonation.voidsetPrincipalFormat(String value) Sets the principal format.voidsetPrincipalFormatEnum(waffle.windows.auth.PrincipalFormat value) Sets the principal format enum.voidsetProvider(waffle.servlet.spi.SecurityFilterProviderCollection value) Sets the provider.voidsetRoleFormat(String value) Sets the role format.voidsetRoleFormatEnum(waffle.windows.auth.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
-
Constructor Details
-
NegotiateSecurityFilter
public NegotiateSecurityFilter()Instantiates a new negotiate security filter.
-
-
Method Details
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Throws:
IOExceptionjakarta.servlet.ServletException
-
setAuthentication
protected boolean setAuthentication(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.- 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 classorg.springframework.web.filter.GenericFilterBean- Throws:
jakarta.servlet.ServletException
-
sendUnauthorized
protected void sendUnauthorized(jakarta.servlet.http.HttpServletResponse response, boolean close) Send a 401 Unauthorized along with protocol authentication headers.- Parameters:
response- HTTP Responseclose- Close connection.
-
getPrincipalFormat
public waffle.windows.auth.PrincipalFormat getPrincipalFormat()Gets the principal format.- Returns:
- the principal format
-
setPrincipalFormatEnum
public void setPrincipalFormatEnum(waffle.windows.auth.PrincipalFormat value) Sets the principal format enum.- Parameters:
value- the new principal format enum
-
setPrincipalFormat
Sets the principal format.- Parameters:
value- the new principal format
-
getRoleFormat
public waffle.windows.auth.PrincipalFormat getRoleFormat()Gets the role format.- Returns:
- the role format
-
setRoleFormatEnum
public void setRoleFormatEnum(waffle.windows.auth.PrincipalFormat value) 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
public waffle.servlet.spi.SecurityFilterProviderCollection getProvider()Gets the provider.- Returns:
- the provider
-
setProvider
public void setProvider(waffle.servlet.spi.SecurityFilterProviderCollection value) 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
-