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

public Class AuthenticationConstraintHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.UndertowLogger, io.undertow.security.api.SecurityContext, io.undertow.server.HttpHandler, .HttpServerExchange

Handler responsible for checking the constraints for the current request and marking authentication as required if applicable. Sub classes can override isAuthenticationRequired to provide a constraint check, by default this handler will set authentication as always required, authentication will be optional if this handler is omitted.
Author
Darran Lofthouse

Field Summary

Modifier and TypeField and Description
private final HttpHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
handleRequest(HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

protected boolean

Returns:

true if authentication is required, false otherwise.
isAuthenticationRequired
(final HttpServerExchange
- the HttpServerExchange for the current request to decide if authentication is required.
exchange
)

Evaluate the current request and indicate if authentication is required for the current request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nextback to summary
private final HttpHandler next

Constructor Detail

AuthenticationConstraintHandlerback to summary
public AuthenticationConstraintHandler(final HttpHandler next)

Method Detail

handleRequestback to summary
public void handleRequest(HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
See Also
io.undertow.server.HttpHandler#handleRequest(io.undertow.server.HttpServerExchange)
isAuthenticationRequiredback to summary
protected boolean isAuthenticationRequired(final HttpServerExchange exchange)

Evaluate the current request and indicate if authentication is required for the current request. By default this will always return true, sub-classes will override this method to provide a more specific check.

Parameters
exchange:HttpServerExchange

- the HttpServerExchange for the current request to decide if authentication is required.

Returns:boolean

true if authentication is required, false otherwise.