04-24-2014 07:03 AM
public LoggedInUser authenticate(HttpServletRequest request,HttpServletResponse response) in the DefaultLoginHander.java which gives back a LoggedInUser. The login is not the problem.
public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {
// Set current application object as thread-local to make it easy accessible
current.set(this);
// Authentication: check if user is found, otherwise send to login page
LoggedInUser user = (LoggedInUser) getUser();
if (user == null) {
// First, try automatic login
user = loginHandler.authenticate(request, response);
if(user == null) {
if (mainWindow != null && !mainWindow.isShowingLoginPage()) {
viewManager.showLoginPage();
}
} else {
setUser(user);
}
}
if(user != null) {
Authentication.setAuthenticatedUserId(user.getId());
if (mainWindow != null && mainWindow.isShowingLoginPage()) {
viewManager.showDefaultPage();
}
}
// Callback to the login handler
loginHandler.onRequestStart(request, response);
}
LoggedInUser user = (LoggedInUser) getUser(); is not null which means that the authenticate-methods get skipped and this will be executed:
if(user != null) {
Authentication.setAuthenticatedUserId(user.getId());
if (mainWindow != null && mainWindow.isShowingLoginPage()) {
viewManager.showDefaultPage();
}
}
LoggedInUser user = (LoggedInUser) getUser(); is not null.
public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {
if(logout){
Cookie[] cookies = request.getCookies();
if(cookies != null){
for (Cookie cookie : cookies){
if(cookie.getName().equals("LtpaToken2")){
Cookie newCookie = new Cookie("LtpaToken2", cookie.getValue());
newCookie.setPath("/");
newCookie.setMaxAge(0);
newCookie.setDomain("****");
response.addCookie(newCookie);
}
}
}
logout = false;
}
}
public void logout(LoggedInUser userToLogout) {
// Clear activiti authentication context
Authentication.setAuthenticatedUserId(null);
logout = true;
}
public void close() {
final LoggedInUser theUser = getLoggedInUser();
// Clear the logged in user
setUser(null);
// Call loginhandler
getLoginHandler().logout(theUser);
invalidatedSession = false;
super.close();
}
public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {
// Set current application object as thread-local to make it easy accessible
current.set(this);
if(loginHandler.getLogoutStatus()){
setUser(null);
}
// Authentication: check if user is found, otherwise send to login page
LoggedInUser user = (LoggedInUser) getUser();
//Delete LTPA2-Token when Logout
loginHandler.onRequestStart(request, response);
if (user == null) {
System.out.println("User ist null, Login procedure");
// First, try automatic login
//LTPA2-SSO-Login
user = loginHandler.authenticate(request, response);
if(user == null) {
if (mainWindow != null && !mainWindow.isShowingLoginPage()) {
viewManager.showLoginPage();
}
} else {
setUser(user);
}
}
if(user != null) {
Authentication.setAuthenticatedUserId(user.getId());
if (mainWindow != null && mainWindow.isShowingLoginPage()) {
viewManager.showDefaultPage();
}
}
// Callback to the login handler
//loginHandler.onRequestStart(request, response);
}
if(loginHandler.getLogoutStatus()){
setUser(null);
}
04-24-2014 12:11 PM
04-25-2014 03:56 AM
02-05-2016 06:54 AM
02-05-2016 07:31 AM
02-08-2016 02:39 AM
02-08-2016 03:30 AM
02-08-2016 08:05 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.