Package waffle.servlet.spi
Class BasicSecurityFilterProvider
java.lang.Object
waffle.servlet.spi.BasicSecurityFilterProvider
- All Implemented Interfaces:
SecurityFilterProvider
A Basic authentication security filter provider. https://tools.ietf.org/html/rfc2617
-
Constructor Summary
ConstructorDescriptionBasicSecurityFilterProvider
(IWindowsAuthProvider newAuthProvider) Instantiates a new basic security filter provider. -
Method Summary
Modifier and TypeMethodDescriptiondoFilter
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Execute filter.getRealm()
Protection space.void
initParameter
(String parameterName, String parameterValue) Init configuration parameters.boolean
isPrincipalException
(javax.servlet.http.HttpServletRequest request) Returns true if despite having a principal authentication needs to happen.boolean
isSecurityPackageSupported
(String securityPackage) Tests whether a specific security package is supported.void
sendUnauthorized
(javax.servlet.http.HttpServletResponse response) Add authentication method headers.void
Set the protection space.
-
Constructor Details
-
BasicSecurityFilterProvider
Instantiates a new basic security filter provider.- Parameters:
newAuthProvider
- the new auth provider
-
-
Method Details
-
doFilter
public IWindowsIdentity doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException Description copied from interface:SecurityFilterProvider
Execute filter.- Specified by:
doFilter
in interfaceSecurityFilterProvider
- Parameters:
request
- Http Servlet Request.response
- Http Servlet Response.- Returns:
- A Windows identity in case authentication completed or NULL if not. Thrown exceptions should be caught and processed as 401 Access Denied.
- Throws:
IOException
- on doFilter.
-
isPrincipalException
public boolean isPrincipalException(javax.servlet.http.HttpServletRequest request) Description copied from interface:SecurityFilterProvider
Returns true if despite having a principal authentication needs to happen.- Specified by:
isPrincipalException
in interfaceSecurityFilterProvider
- Parameters:
request
- Http Request.- Returns:
- True if authentication is required.
-
isSecurityPackageSupported
Description copied from interface:SecurityFilterProvider
Tests whether a specific security package is supported.- Specified by:
isSecurityPackageSupported
in interfaceSecurityFilterProvider
- Parameters:
securityPackage
- Security package.- Returns:
- True if the security package is supported, false otherwise.
-
sendUnauthorized
public void sendUnauthorized(javax.servlet.http.HttpServletResponse response) Description copied from interface:SecurityFilterProvider
Add authentication method headers.- Specified by:
sendUnauthorized
in interfaceSecurityFilterProvider
- Parameters:
response
- Http Response.
-
getRealm
Protection space.- Returns:
- Name of the protection space.
-
setRealm
Set the protection space.- Parameters:
value
- Protection space name.
-
initParameter
Init configuration parameters.- Specified by:
initParameter
in interfaceSecurityFilterProvider
- Parameters:
parameterName
- the parameter nameparameterValue
- the parameter value
-