Top Description Fields Constructors Methods
waffle.servlet.spi

public Class BasicSecurityFilterProvider

extends Object
implements SecurityFilterProvider
Class Inheritance
All Implemented Interfaces
waffle.servlet.spi.SecurityFilterProvider
Imports
java.io.IOException, java.nio.charset.StandardCharsets, java.security.InvalidParameterException, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.slf4j.Logger, .LoggerFactory, waffle.util.AuthorizationHeader, waffle.windows.auth.IWindowsAuthProvider, .IWindowsIdentity

A Basic authentication security filter provider. https://tools.ietf.org/html/rfc2617
Author
dblock[at]dblock[dot]org

Field Summary

Modifier and TypeField and Description
private final IWindowsAuthProvider
auth

The auth.

private static final Logger
LOGGER

The Constant LOGGER.

private String
realm

The realm.

Constructor Summary

AccessConstructor and Description
public
BasicSecurityFilterProvider(final IWindowsAuthProvider
the new auth provider
newAuthProvider
)

Instantiates a new basic security filter provider.

Method Summary

Modifier and TypeMethod and Description
public IWindowsIdentity
doFilter(final HttpServletRequest
Http Servlet Request.
request
,
final HttpServletResponse
Http Servlet Response.
response
)

Implements waffle.servlet.spi.SecurityFilterProvider.doFilter.

Execute filter.
public String

Returns:

Name of the protection space.
getRealm
()

Protection space.

public void
initParameter(final String
the parameter name
parameterName
,
final String
the parameter value
parameterValue
)

Implements waffle.servlet.spi.SecurityFilterProvider.initParameter.

Init configuration parameters.
public boolean
isPrincipalException(final HttpServletRequest
Http Request.
request
)

Implements waffle.servlet.spi.SecurityFilterProvider.isPrincipalException.

Returns true if despite having a principal authentication needs to happen.
public boolean
isSecurityPackageSupported(final String
Security package.
securityPackage
)

Implements waffle.servlet.spi.SecurityFilterProvider.isSecurityPackageSupported.

Tests whether a specific security package is supported.
public void
sendUnauthorized(final HttpServletResponse
Http Response.
response
)

Implements waffle.servlet.spi.SecurityFilterProvider.sendUnauthorized.

Add authentication method headers.
public void
setRealm(final String
Protection space name.
value
)

Set the protection space.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

authback to summary
private final IWindowsAuthProvider auth

The auth.

LOGGERback to summary
private static final Logger LOGGER

The Constant LOGGER.

realmback to summary
private String realm

The realm.

Constructor Detail

BasicSecurityFilterProviderback to summary
public BasicSecurityFilterProvider(final IWindowsAuthProvider newAuthProvider)

Instantiates a new basic security filter provider.

Parameters
newAuthProvider:IWindowsAuthProvider

the new auth provider

Method Detail

doFilterback to summary
public IWindowsIdentity doFilter(final HttpServletRequest request, final HttpServletResponse response) throws IOException

Implements waffle.servlet.spi.SecurityFilterProvider.doFilter.

Doc from waffle.servlet.spi.SecurityFilterProvider.doFilter.

Execute filter.

Parameters
request:HttpServletRequest

Http Servlet Request.

response:HttpServletResponse

Http Servlet Response.

Returns:IWindowsIdentity

A Windows identity in case authentication completed or NULL if not. Thrown exceptions should be caught and processed as 401 Access Denied.

Annotations
@Override
Exceptions
IOException:
on doFilter.
getRealmback to summary
public String getRealm()

Protection space.

Returns:String

Name of the protection space.

initParameterback to summary
public void initParameter(final String parameterName, final String parameterValue)

Implements waffle.servlet.spi.SecurityFilterProvider.initParameter.

Init configuration parameters.

Parameters
parameterName:String

the parameter name

parameterValue:String

the parameter value

Annotations
@Override
isPrincipalExceptionback to summary
public boolean isPrincipalException(final HttpServletRequest request)

Implements waffle.servlet.spi.SecurityFilterProvider.isPrincipalException.

Doc from waffle.servlet.spi.SecurityFilterProvider.isPrincipalException.

Returns true if despite having a principal authentication needs to happen.

Parameters
request:HttpServletRequest

Http Request.

Returns:boolean

True if authentication is required.

Annotations
@Override
isSecurityPackageSupportedback to summary
public boolean isSecurityPackageSupported(final String securityPackage)

Implements waffle.servlet.spi.SecurityFilterProvider.isSecurityPackageSupported.

Doc from waffle.servlet.spi.SecurityFilterProvider.isSecurityPackageSupported.

Tests whether a specific security package is supported.

Parameters
securityPackage:String

Security package.

Returns:boolean

True if the security package is supported, false otherwise.

Annotations
@Override
sendUnauthorizedback to summary
public void sendUnauthorized(final HttpServletResponse response)

Implements waffle.servlet.spi.SecurityFilterProvider.sendUnauthorized.

Doc from waffle.servlet.spi.SecurityFilterProvider.sendUnauthorized.

Add authentication method headers.

Parameters
response:HttpServletResponse

Http Response.

Annotations
@Override
setRealmback to summary
public void setRealm(final String value)

Set the protection space.

Parameters
value:String

Protection space name.