Top Fields Constructors Methods
io.undertow.security.impl

public Class FormAuthenticationMechanism

extends Object
implements AuthenticationMechanism
Class Inheritance
All Implemented Interfaces
io.undertow.security.api.AuthenticationMechanism
Imports
io.undertow.UndertowLogger, io.undertow.security.api.AuthenticationMechanism, .SecurityContext, io.undertow.security.idm.Account, .IdentityManager, .PasswordCredential, io.undertow.server.DefaultResponseListener, .HttpServerExchange, io.undertow.server.handlers.form.FormData, .FormDataParser, .FormParserFactory, io.undertow.server.session.Session, io.undertow.util.Headers, .Methods, .RedirectBuilder, .Sessions, .StatusCodes, java.io.IOException, .UncheckedIOException

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
public static final String
private final String
private final FormParserFactory
private final IdentityManager
public static final String
private final String
private final String
private final String

Constructor Summary

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

public
FormAuthenticationMechanism(final String name, final String loginPage, final String errorPage, final String postLocation)

public
FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage)

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

public
FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage, final String postLocation)

public
FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage, final String postLocation, final IdentityManager identityManager)

Method Summary

Modifier and TypeMethod and Description
public AuthenticationMechanism.AuthenticationMechanismOutcome
authenticate(final HttpServerExchange
The exchange
exchange
,
final SecurityContext securityContext)

Implements io.undertow.security.api.AuthenticationMechanism.authenticate.

Perform authentication of the request.

private IdentityManager
protected void
public AuthenticationMechanism.AuthenticationMechanismOutcome
runFormAuth(final HttpServerExchange exchange, final SecurityContext securityContext)

public AuthenticationMechanism.ChallengeResult
sendChallenge(final HttpServerExchange
The exchange
exchange
,
final SecurityContext
The security context
securityContext
)

Implements io.undertow.security.api.AuthenticationMechanism.sendChallenge.

Send an authentication challenge to the remote client.

pack-priv static void
sendRedirect(final HttpServerExchange exchange, final String location)

protected Integer
servePage(final HttpServerExchange exchange, final String location)

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_POST_LOCATIONback to summary
public static final String DEFAULT_POST_LOCATION
errorPageback to summary
private final String errorPage
formParserFactoryback to summary
private final FormParserFactory formParserFactory
identityManagerback to summary
private final IdentityManager identityManager
LOCATION_ATTRIBUTEback to summary
public static final String LOCATION_ATTRIBUTE
loginPageback to summary
private final String loginPage
nameback to summary
private final String name
postLocationback to summary
private final String postLocation

Constructor Detail

FormAuthenticationMechanismback to summary
public FormAuthenticationMechanism(final String name, final String loginPage, final String errorPage)
FormAuthenticationMechanismback to summary
public FormAuthenticationMechanism(final String name, final String loginPage, final String errorPage, final String postLocation)
FormAuthenticationMechanismback to summary
public FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage)
FormAuthenticationMechanismback to summary
public FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage, final IdentityManager identityManager)
FormAuthenticationMechanismback to summary
public FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage, final String postLocation)
FormAuthenticationMechanismback to summary
public FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage, final String postLocation, final IdentityManager identityManager)

Method Detail

authenticateback to summary
public AuthenticationMechanism.AuthenticationMechanismOutcome authenticate(final HttpServerExchange exchange, final SecurityContext securityContext)

Implements io.undertow.security.api.AuthenticationMechanism.authenticate.

Doc from io.undertow.security.api.AuthenticationMechanism.authenticate.

Perform authentication of the request. Any potentially blocking work should be performed in the handoff executor provided

Parameters
exchange:HttpServerExchange

The exchange

Annotations
@Override
getIdentityManagerback to summary
private IdentityManager getIdentityManager(SecurityContext securityContext)
Annotations
@SuppressWarnings:deprecation
handleRedirectBackback to summary
protected void handleRedirectBack(final HttpServerExchange exchange)
runFormAuthback to summary
public AuthenticationMechanism.AuthenticationMechanismOutcome runFormAuth(final HttpServerExchange exchange, final SecurityContext securityContext)
sendChallengeback to summary
public AuthenticationMechanism.ChallengeResult sendChallenge(final HttpServerExchange exchange, final SecurityContext securityContext)

Implements io.undertow.security.api.AuthenticationMechanism.sendChallenge.

Doc from io.undertow.security.api.AuthenticationMechanism.sendChallenge.

Send an authentication challenge to the remote client.

The individual mechanisms should update the response headers and body of the message as appropriate however they should not set the response code, instead that should be indicated in the ChallengeResult and the most appropriate overall response code will be selected. This method should not return null.

Parameters
exchange:HttpServerExchange

The exchange

securityContext:SecurityContext

The security context

Returns:AuthenticationMechanism.ChallengeResult

A ChallengeResult indicating if a challenge was sent and the desired response code.

sendRedirectback to summary
pack-priv static void sendRedirect(final HttpServerExchange exchange, final String location)
servePageback to summary
protected Integer servePage(final HttpServerExchange exchange, final String location)
storeInitialLocationback to summary
protected void storeInitialLocation(final HttpServerExchange exchange)