Top Description Inners Fields Constructors Methods
io.undertow.servlet.handlers.security

public Class ServletFormAuthenticationMechanism

extends FormAuthenticationMechanism
Class Inheritance
Static Imports
io.undertow.util.StatusCodes.OK

Servlet handler for FORM authentication. Instead of using a redirect it serves up error and login pages immediately using a forward
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class

Field Summary

Modifier and TypeField and Description
private final String
public static final AuthenticationMechanismFactory
private static final SessionListener
private final boolean
public static final String
private final boolean
private final Set<SessionManager>
private static final String
Inherited from io.undertow.security.impl.FormAuthenticationMechanism:
DEFAULT_POST_LOCATIONLOCATION_ATTRIBUTE

Constructor Summary

AccessConstructor and Description
public
ServletFormAuthenticationMechanism(final String name, final String loginPage, final String errorPage)
Deprecated

public
ServletFormAuthenticationMechanism(final String name, final String loginPage, final String errorPage, final String postLocation)
Deprecated

public
ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, String postLocation)

public
ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage)

public
ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, IdentityManager identityManager)

public
ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, IdentityManager identityManager, boolean saveOriginalRequest)

public
ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, String defaultPage, boolean overrideInitial, IdentityManager identityManager, boolean saveOriginalRequest)

Method Summary

Modifier and TypeMethod and Description
protected void
protected Integer
protected void
protected void
storeInitialLocation(final HttpServerExchange exchange, byte[] bytes, int contentLength)

This method doesn't save content of request but instead uses data from parameter.

Inherited from io.undertow.security.impl.FormAuthenticationMechanism:
authenticaterunFormAuthsendChallenge

Field Detail

defaultPageback to summary
private final String defaultPage
FACTORYback to summary
public static final AuthenticationMechanismFactory FACTORY
LISTENERback to summary
private static final SessionListener LISTENER
overrideInitialback to summary
private final boolean overrideInitial
SAVE_ORIGINAL_REQUESTback to summary
public static final String SAVE_ORIGINAL_REQUEST
saveOriginalRequestback to summary
private final boolean saveOriginalRequest
seenSessionManagersback to summary
private final Set<SessionManager> seenSessionManagers
SESSION_KEYback to summary
private static final String SESSION_KEY

Constructor Detail

ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(final String name, final String loginPage, final String errorPage)

Deprecated

Annotations
@Deprecated
ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(final String name, final String loginPage, final String errorPage, final String postLocation)

Deprecated

Annotations
@Deprecated
ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, String postLocation)
ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage)
ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, IdentityManager identityManager)
ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, IdentityManager identityManager, boolean saveOriginalRequest)
ServletFormAuthenticationMechanismback to summary
public ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, String defaultPage, boolean overrideInitial, IdentityManager identityManager, boolean saveOriginalRequest)

Method Detail

handleRedirectBackback to summary
protected void handleRedirectBack(final HttpServerExchange exchange)

Overrides io.undertow.security.impl.FormAuthenticationMechanism.handleRedirectBack.

Annotations
@Override
servePageback to summary
protected Integer servePage(final HttpServerExchange exchange, final String location)

Overrides io.undertow.security.impl.FormAuthenticationMechanism.servePage.

Annotations
@Override
storeInitialLocationback to summary
protected void storeInitialLocation(final HttpServerExchange exchange)

Overrides io.undertow.security.impl.FormAuthenticationMechanism.storeInitialLocation.

Annotations
@Override
storeInitialLocationback to summary
protected void storeInitialLocation(final HttpServerExchange exchange, byte[] bytes, int contentLength)

This method doesn't save content of request but instead uses data from parameter. This should be used in case that data from request was already read and therefore it is not possible to save them.

io.undertow.servlet.handlers.security back to summary

public Class ServletFormAuthenticationMechanism.Factory

extends Object
implements AuthenticationMechanismFactory
Class Inheritance
  • java.lang.Object
  • io.undertow.servlet.handlers.security.ServletFormAuthenticationMechanism.Factory
All Implemented Interfaces
io.undertow.security.api.AuthenticationMechanismFactory

Constructor Summary

AccessConstructor and Description
public
Factory(IdentityManager identityManager)
Deprecated

public

Method Summary

Modifier and TypeMethod and Description
public AuthenticationMechanism
create(String
The name under which this factory was registered
mechanismName
,
IdentityManager
the IdentityManager instance asscociated with the deployment
identityManager
,
FormParserFactory
Parser to create a form data parser for a given request.
formParserFactory
,
Map<String, String>
The properties
properties
)

Overrides default io.undertow.security.api.AuthenticationMechanismFactory.create.

Creates an authentication mechanism that needs access to the deployment IdentityManager and specified properties

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Factoryback to summary
public Factory(IdentityManager identityManager)

Deprecated

Annotations
@Deprecated
Factoryback to summary
public Factory()

Method Detail

createback to summary
public AuthenticationMechanism create(String mechanismName, IdentityManager identityManager, FormParserFactory formParserFactory, Map<String, String> properties)

Overrides default io.undertow.security.api.AuthenticationMechanismFactory.create.

Doc from io.undertow.security.api.AuthenticationMechanismFactory.create.

Creates an authentication mechanism that needs access to the deployment IdentityManager and specified properties

Parameters
mechanismName:String

The name under which this factory was registered

identityManager:IdentityManager

the IdentityManager instance asscociated with the deployment

formParserFactory:FormParserFactory

Parser to create a form data parser for a given request.

properties:Map<String, String>

The properties

Returns:AuthenticationMechanism

The mechanism

Annotations
@Override
io.undertow.servlet.handlers.security back to summary

private Class ServletFormAuthenticationMechanism.FormResponseWrapper

extends HttpServletResponseWrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getStatus()

Overrides jakarta.servlet.http.HttpServletResponseWrapper.getStatus.

Implements jakarta.servlet.http.HttpServletResponse.getStatus.

The default behaviour of this method is to call HttpServletResponse#getStatus on the wrapped response object.

public void
setStatus(int
the status code
sc
)

Overrides jakarta.servlet.http.HttpServletResponseWrapper.setStatus.

Implements jakarta.servlet.http.HttpServletResponse.setStatus.

The default behavior of this method is to call setStatus(int sc) on the wrapped response object.

Inherited from jakarta.servlet.http.HttpServletResponseWrapper:
addCookieaddDateHeaderaddHeaderaddIntHeadercontainsHeaderencodeRedirectURLencodeURLgetHeadergetHeaderNamesgetHeadersgetTrailerFieldssendErrorsendErrorsendRedirectsetDateHeadersetHeadersetIntHeadersetTrailerFields

Field Detail

statusback to summary
private int status

Constructor Detail

FormResponseWrapperback to summary
private FormResponseWrapper(final HttpServletResponse wrapped)

Method Detail

getStatusback to summary
public int getStatus()

Overrides jakarta.servlet.http.HttpServletResponseWrapper.getStatus.

Implements jakarta.servlet.http.HttpServletResponse.getStatus.

Doc from jakarta.servlet.http.HttpServletResponseWrapper.getStatus.

The default behaviour of this method is to call HttpServletResponse#getStatus on the wrapped response object.

Returns:int

the current status code of the wrapped response

Annotations
@Override
setStatusback to summary
public void setStatus(int sc)

Overrides jakarta.servlet.http.HttpServletResponseWrapper.setStatus.

Implements jakarta.servlet.http.HttpServletResponse.setStatus.

Doc from jakarta.servlet.http.HttpServletResponseWrapper.setStatus.

The default behavior of this method is to call setStatus(int sc) on the wrapped response object.

Parameters
sc:int

Doc from jakarta.servlet.http.HttpServletResponse.setStatus.

the status code

Annotations
@Override