Package waffle.servlet.spi
Class BasicSecurityFilterProvider
- java.lang.Object
-
- waffle.servlet.spi.BasicSecurityFilterProvider
-
- All Implemented Interfaces:
SecurityFilterProvider
public class BasicSecurityFilterProvider extends Object implements SecurityFilterProvider
A Basic authentication security filter provider. https://tools.ietf.org/html/rfc2617- Author:
- dblock[at]dblock[dot]org
-
-
Constructor Summary
Constructors Constructor Description BasicSecurityFilterProvider(IWindowsAuthProvider newAuthProvider)Instantiates a new basic security filter provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IWindowsIdentitydoFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Execute filter.StringgetRealm()Protection space.voidinitParameter(String parameterName, String parameterValue)Init configuration parameters.booleanisPrincipalException(javax.servlet.http.HttpServletRequest request)Returns true if despite having a principal authentication needs to happen.booleanisSecurityPackageSupported(String securityPackage)Tests whether a specific security package is supported.voidsendUnauthorized(javax.servlet.http.HttpServletResponse response)Add authentication method headers.voidsetRealm(String value)Set the protection space.
-
-
-
Constructor Detail
-
BasicSecurityFilterProvider
public BasicSecurityFilterProvider(IWindowsAuthProvider newAuthProvider)
Instantiates a new basic security filter provider.- Parameters:
newAuthProvider- the new auth provider
-
-
Method Detail
-
doFilter
public IWindowsIdentity doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Description copied from interface:SecurityFilterProviderExecute filter.- Specified by:
doFilterin 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:SecurityFilterProviderReturns true if despite having a principal authentication needs to happen.- Specified by:
isPrincipalExceptionin interfaceSecurityFilterProvider- Parameters:
request- Http Request.- Returns:
- True if authentication is required.
-
isSecurityPackageSupported
public boolean isSecurityPackageSupported(String securityPackage)
Description copied from interface:SecurityFilterProviderTests whether a specific security package is supported.- Specified by:
isSecurityPackageSupportedin 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:SecurityFilterProviderAdd authentication method headers.- Specified by:
sendUnauthorizedin interfaceSecurityFilterProvider- Parameters:
response- Http Response.
-
getRealm
public String getRealm()
Protection space.- Returns:
- Name of the protection space.
-
setRealm
public void setRealm(String value)
Set the protection space.- Parameters:
value- Protection space name.
-
initParameter
public void initParameter(String parameterName, String parameterValue)
Init configuration parameters.- Specified by:
initParameterin interfaceSecurityFilterProvider- Parameters:
parameterName- the parameter nameparameterValue- the parameter value
-
-