Class FormLoginPageHandler<A extends ExchangeContext,B extends Exchange<A>>
- Type Parameters:
A
- the type of the exchange contextB
- the type of exchange handled by the handler
- All Implemented Interfaces:
ExchangeHandler<A,
,B> ReactiveExchangeHandler<A,
B>
An exhange handler that serves a whitelabel login HTML page.
The resulting HTML page contains a login form with username
and password
parameters that can be used by a user to submit login credentials and enter an application.
Providing a custom login page is recommended.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a form login page handler targeting the default login action URI.FormLoginPageHandler
(String loginActionUri) Creates a form login page handler targeting the specified login action URI. -
Method Summary
Modifier and TypeMethodDescriptionReturns the login action URI targeted by the login form.void
Processes the specified server exchange.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.http.server.ExchangeHandler
defer
Methods inherited from interface io.inverno.mod.http.server.ReactiveExchangeHandler
intercept
-
Field Details
-
DEFAULT_LOGIN_ACTION_URI
The default login action URI:/login
.- See Also:
-
PARAMETER_REDIRECT_URI
The redirect URI query parameter name.This constant is also used in
FormAuthenticationErrorInterceptor
,RedirectLoginSuccessHandler
andRedirectLoginFailureHandler
.- See Also:
-
PARAMETER_ERROR
The error query parameter name.This constant is also used in
FormAuthenticationErrorInterceptor
,RedirectLoginSuccessHandler
andRedirectLoginFailureHandler
.- See Also:
-
-
Constructor Details
-
FormLoginPageHandler
public FormLoginPageHandler()Creates a form login page handler targeting the default login action URI.
-
FormLoginPageHandler
Creates a form login page handler targeting the specified login action URI.
- Parameters:
loginActionUri
- the login action URI targeted by the login form
-
-
Method Details
-
getLoginActionUri
Returns the login action URI targeted by the login form.
- Returns:
- a login action URI
-
handle
Description copied from interface:ExchangeHandler
Processes the specified server exchange.
This method is more convenient than
ExchangeHandler.defer(io.inverno.mod.http.server.Exchange)
when the handling logic does not need to be reactive.- Specified by:
handle
in interfaceExchangeHandler<A extends ExchangeContext,
B extends Exchange<A>> - Parameters:
exchange
- the exchange to process- Throws:
HttpException
- if an error occurs during the processing of the exchange
-