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 and Description
`BasicSecurityFilterProvider(IWindowsAuthProvider newAuthProvider)` Instantiates a new basic security filter provider.

### Method Summary

All Methods Instance Methods Concrete Methods
`IWindowsIdentity` `doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Execute filter.
`String` `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` `setRealm(String value)` Set the protection space.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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: `SecurityFilterProvider`
Execute filter.

Specified by:
  `doFilter` in interface `SecurityFilterProvider`
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 interface `SecurityFilterProvider`
Parameters:
  `request` - Http Request.
Returns:
  True if authentication is required.

#### isSecurityPackageSupported

    public boolean isSecurityPackageSupported(String securityPackage)

Description copied from interface: `SecurityFilterProvider`
Tests whether a specific security package is supported.

Specified by:
  `isSecurityPackageSupported` in interface `SecurityFilterProvider`
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 interface `SecurityFilterProvider`
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:
  `initParameter` in interface `SecurityFilterProvider`
Parameters:
  `parameterName` - the parameter name
  `parameterValue` - the parameter value