@Service public class FormLogin extends AbstractLogin
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_errorPage |
protected boolean |
_formURIPriority |
protected boolean |
_internalForward |
protected java.lang.String |
_loginPage |
static java.lang.String |
LOGIN_CHECK |
static java.lang.String |
LOGIN_SAVED_PATH |
static java.lang.String |
LOGIN_SAVED_QUERY |
_auth, _singleSignon
LOGIN_PASSWORD, LOGIN_USER, LOGIN_USER_NAME
Constructor and Description |
---|
FormLogin() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAuthType()
Returns the authentication type.
|
java.lang.String |
getFormErrorPage()
Gets the error page.
|
java.lang.String |
getFormLoginPage()
Gets the login page.
|
boolean |
getFormURIPriority()
Returns true if the form's j_uri has priority over the saved
URL.
|
boolean |
getInternalForward()
Returns true if a successful login allows an internal forward
instead of a redirect.
|
java.security.Principal |
getUserPrincipalImpl(HttpServletRequest request)
Logs a user in with a user name and a password.
|
void |
init()
Initialize
|
boolean |
isLoginUsedForRequest(HttpServletRequest request)
Returns true if the request has a matching login.
|
protected boolean |
isSavedUserValid(HttpServletRequest request,
java.security.Principal savedUser)
Returns true if a new login overrides the saved user
|
void |
loginChallenge(HttpServletRequest request,
HttpServletResponse response)
Logs a user in with a user name and a password.
|
void |
loginSuccessResponse(java.security.Principal user,
HttpServletRequest request,
HttpServletResponse response)
Updates after a successful login
|
void |
setErrorPage(java.lang.String errorPage) |
void |
setFormErrorPage(java.lang.String formErrorPage)
Sets the error page.
|
void |
setFormLoginPage(java.lang.String formLoginPage)
Sets the login page.
|
void |
setFormURIPriority(boolean formPriority)
True if the form's j_uri has priority over the saved URL.
|
void |
setInternalForward(boolean internalForward)
Set true if a successful login allows an internal forward
instead of a redirect.
|
void |
setLoginPage(java.lang.String loginPage) |
findSavedUser, getAuthenticator, getLoginPrincipalImpl, getSingleSignon, getUserPrincipal, isLogoutOnSessionTimeout, isPasswordBased, isSessionSaveLogin, isUserInRole, login, login, logout, logoutImpl, saveUser, sessionInvalidate, setAuthenticator, setLogoutOnSessionTimeout, setSessionSaveLogin, toString
public static final java.lang.String LOGIN_CHECK
public static final java.lang.String LOGIN_SAVED_PATH
public static final java.lang.String LOGIN_SAVED_QUERY
protected java.lang.String _loginPage
protected java.lang.String _errorPage
protected boolean _internalForward
protected boolean _formURIPriority
public void setFormLoginPage(java.lang.String formLoginPage) throws ConfigException
ConfigException
public void setLoginPage(java.lang.String loginPage)
public java.lang.String getFormLoginPage()
public void setFormErrorPage(java.lang.String formErrorPage) throws ConfigException
ConfigException
public void setErrorPage(java.lang.String errorPage)
public java.lang.String getFormErrorPage()
public boolean getInternalForward()
public void setInternalForward(boolean internalForward)
public boolean getFormURIPriority()
public void setFormURIPriority(boolean formPriority)
@PostConstruct public void init() throws ServletException
init
in class AbstractLogin
ServletException
public java.lang.String getAuthType()
getAuthType
in interface Login
getAuthType
in class AbstractLogin
public boolean isLoginUsedForRequest(HttpServletRequest request)
isLoginUsedForRequest
in interface Login
isLoginUsedForRequest
in class AbstractLogin
public java.security.Principal getUserPrincipalImpl(HttpServletRequest request)
getUserPrincipalImpl
in class AbstractLogin
request
- servlet requestprotected boolean isSavedUserValid(HttpServletRequest request, java.security.Principal savedUser)
isSavedUserValid
in class AbstractLogin
public void loginSuccessResponse(java.security.Principal user, HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
loginSuccessResponse
in class AbstractLogin
request
- servlet requestresponse
- servlet response, in case any cookie need sending.ServletException
java.io.IOException
public void loginChallenge(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
loginChallenge
in class AbstractLogin
request
- servlet requestresponse
- servlet response, in case any cookie need sending.application
- servlet applicationServletException
java.io.IOException