Package waffle.servlet

## Class NegotiateSecurityFilter

- java.lang.Object
- - waffle.servlet.NegotiateSecurityFilter

All Implemented Interfaces:
  `javax.servlet.Filter`

Direct Known Subclasses:
  `CorsAwareNegotiateSecurityFilter`

    public class NegotiateSecurityFilter
    extends Object
    implements javax.servlet.Filter

A Negotiate (NTLM/Kerberos) Security Filter.

Author:
  dblock[at]dblock[dot]org

### Constructor Summary

Constructors
`NegotiateSecurityFilter​()` Instantiates a new negotiate security filter.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `destroy​()`
`void` `doFilter​(javax.servlet.ServletRequest sreq, javax.servlet.ServletResponse sres, javax.servlet.FilterChain chain)`
`IWindowsAuthProvider` `getAuth​()` Windows auth provider.
`PrincipalFormat` `getPrincipalFormat​()` Principal format.
`SecurityFilterProviderCollection` `getProviders​()` Security filter providers.
`PrincipalFormat` `getRoleFormat​()` Principal format.
`void` `init​(javax.servlet.FilterConfig filterConfig)`
`boolean` `isAllowGuestLogin​()` True if guest login is allowed.
`boolean` `isImpersonate​()` Checks if is impersonate.
`void` `setAuth​(IWindowsAuthProvider provider)` Set Windows auth provider.
`void` `setImpersonate​(boolean value)` Enable/Disable impersonation.
`void` `setPrincipalFormat​(String format)` Set the principal format.
`void` `setRoleFormat​(String format)` Set the principal format.

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

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

### Constructor Detail

#### NegotiateSecurityFilter

    public NegotiateSecurityFilter​()

Instantiates a new negotiate security filter.

### Method Detail

#### destroy

    public void destroy​()

Specified by:
  `destroy` in interface `javax.servlet.Filter`

#### doFilter

    public void doFilter​(javax.servlet.ServletRequest sreq,
                         javax.servlet.ServletResponse sres,
                         javax.servlet.FilterChain chain)
                  throws IOException,
                         javax.servlet.ServletException

Specified by:
  `doFilter` in interface `javax.servlet.Filter`
Throws:
  `IOException`
  `javax.servlet.ServletException`

#### init

    public void init​(javax.servlet.FilterConfig filterConfig)
              throws javax.servlet.ServletException

Specified by:
  `init` in interface `javax.servlet.Filter`
Throws:
  `javax.servlet.ServletException`

#### setPrincipalFormat

    public void setPrincipalFormat​(String format)

Set the principal format.

Parameters:
  `format` - Principal format.

#### getPrincipalFormat

    public PrincipalFormat getPrincipalFormat​()

Principal format.

Returns:
  Principal format.

#### setRoleFormat

    public void setRoleFormat​(String format)

Set the principal format.

Parameters:
  `format` - Role format.

#### getRoleFormat

    public PrincipalFormat getRoleFormat​()

Principal format.

Returns:
  Role format.

#### getAuth

    public IWindowsAuthProvider getAuth​()

Windows auth provider.

Returns:
  IWindowsAuthProvider.

#### setAuth

    public void setAuth​(IWindowsAuthProvider provider)

Set Windows auth provider.

Parameters:
  `provider` - Class implements IWindowsAuthProvider.

#### isAllowGuestLogin

    public boolean isAllowGuestLogin​()

True if guest login is allowed.

Returns:
  True if guest login is allowed, false otherwise.

#### 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

#### getProviders

    public SecurityFilterProviderCollection getProviders​()

Security filter providers.

Returns:
  A collection of security filter providers.