use of org.lastaflute.web.login.exception.LoginFailureException in project fess by codelibs.
the class SsoAction method index.
// ===================================================================================
// Login Execute
// ==============
@Execute
public ActionResponse index() {
final SsoManager ssoManager = ComponentUtil.getSsoManager();
final LoginCredential loginCredential = ssoManager.getLoginCredential();
if (loginCredential == null) {
if (logger.isDebugEnabled()) {
logger.debug("No user in SSO request.");
}
if (ssoManager.available()) {
saveError(messages -> messages.addErrorsSsoLoginError(GLOBAL));
}
return redirect(LoginAction.class);
} else if (loginCredential instanceof ActionResponseCredential) {
return ((ActionResponseCredential) loginCredential).execute();
}
try {
return fessLoginAssist.loginRedirect(loginCredential, op -> {
}, () -> {
activityHelper.login(getUserBean());
userInfoHelper.deleteUserCodeFromCookie(request);
return getHtmlResponse();
});
} catch (final LoginFailureException lfe) {
if (logger.isDebugEnabled()) {
logger.debug("SSO login failure.", lfe);
}
if (ssoManager.available()) {
saveError(messages -> messages.addErrorsSsoLoginError(GLOBAL));
}
return redirect(LoginAction.class);
}
}
use of org.lastaflute.web.login.exception.LoginFailureException in project fess by codelibs.
the class LoginAction method login.
@Execute
public HtmlResponse login(final LoginForm form) {
validate(form, messages -> {
}, () -> asIndexPage(form));
verifyToken(() -> asIndexPage(form));
final String username = form.username;
final String password = form.password;
form.clearSecurityInfo();
try {
return fessLoginAssist.loginRedirect(new UserPasswordCredential(username, password), op -> {
}, () -> {
activityHelper.login(getUserBean());
userInfoHelper.deleteUserCodeFromCookie(request);
return getHtmlResponse();
});
} catch (final LoginFailureException lfe) {
throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> asIndexPage(form));
}
return redirect(getClass());
}
Aggregations