public class LoginInterceptor extends AbstractInterceptor
The login interceptor can be used to restrict and secure end user access to an arbitrary web application.
Users firstly have to authenticate themselves against a directory server using a username and password. Secondly, a numeric token is then sent to the user's cell phone using a text message service. After token verification, access to the web application is granted for the user's session. Single Sign On can easily be realized using a small source code extension or modification of a web application.
The login interceptor combines 4 modules to implement its functionality. One implementation of each of the 4 module types is required. (The session manager and account blocker have default implementations.)
The user data provider checks user passwords and provides additional data for each user (e.g. cell phone number, Single Sign On data, etc.).
The session manager tracks the users' sessions across different HTTP requests (e.g. using a session cookie).
The account blocker tracks the number of failed login attempts and might block future login attempts for a specified amount of time.
The token provider generates the numeric token (possibly transmitting it to the user via a secondary channel like text messaging).
(Whether text messages and LDAP is actually used depends on the configuration. Alternatives are possible.)
The login interceptor realizes the login workflow. If all information entered by the user is valid, the workflow is as follows:
Interceptor.Flowid, name, router| Constructor and Description |
|---|
LoginInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
AccountBlocker |
getAccountBlocker() |
String |
getLocation() |
String |
getMessage() |
String |
getPath() |
SessionManager |
getSessionManager() |
TokenProvider |
getTokenProvider() |
UserDataProvider |
getUserDataProvider() |
Outcome |
handleRequest(Exchange exc) |
Outcome |
handleResponse(Exchange exc) |
void |
init()
Called after parsing is complete and this has been added to the object tree (whose root is Router).
|
void |
init(Router router) |
boolean |
isExposeUserCredentialsToSession() |
void |
setAccountBlocker(AccountBlocker accountBlocker) |
void |
setExposeUserCredentialsToSession(boolean exposeUserCredentialsToSession) |
void |
setLocation(String location) |
void |
setMessage(String message) |
void |
setPath(String path) |
void |
setSessionManager(SessionManager sessionManager) |
void |
setTokenProvider(TokenProvider tokenProvider) |
void |
setUserDataProvider(UserDataProvider userDataProvider) |
getDisplayName, getFlow, getHelpId, getId, getLongDescription, getRouter, getRule, getShortDescription, handleAbort, setDisplayName, setFlow, setIdpublic void init()
throws Exception
AbstractInterceptorinit in class AbstractInterceptorExceptionpublic void init(Router router) throws Exception
init in interface Interceptorinit in class AbstractInterceptorExceptionpublic Outcome handleRequest(Exchange exc) throws Exception
handleRequest in interface InterceptorhandleRequest in class AbstractInterceptorExceptionpublic Outcome handleResponse(Exchange exc) throws Exception
handleResponse in interface InterceptorhandleResponse in class AbstractInterceptorExceptionpublic String getLocation()
public void setLocation(String location)
public String getPath()
public void setPath(String path)
public UserDataProvider getUserDataProvider()
public void setUserDataProvider(UserDataProvider userDataProvider)
public TokenProvider getTokenProvider()
public void setTokenProvider(TokenProvider tokenProvider)
public SessionManager getSessionManager()
public void setSessionManager(SessionManager sessionManager)
public AccountBlocker getAccountBlocker()
public void setAccountBlocker(AccountBlocker accountBlocker)
public boolean isExposeUserCredentialsToSession()
public void setExposeUserCredentialsToSession(boolean exposeUserCredentialsToSession)
public String getMessage()
public void setMessage(String message)
Copyright © 2022. All Rights Reserved.