1 43 package net.jforum.sso; 44 45 import javax.servlet.http.HttpServletRequest ; 46 47 import net.jforum.ActionServletRequest; 48 import net.jforum.entities.UserSession; 49 import net.jforum.util.preferences.ConfigKeys; 50 import net.jforum.util.preferences.SystemGlobals; 51 52 61 public class RemoteUserSSO implements SSO 62 { 63 66 public String authenticateUser(ActionServletRequest request) 67 { 68 return request.getRemoteUser(); 69 } 70 71 72 public boolean isSessionValid(UserSession userSession, HttpServletRequest request) 73 { 74 String remoteUser = request.getRemoteUser(); 75 76 if(remoteUser == null && userSession.getUserId() != SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID)) { 78 return false; 79 80 } else if(remoteUser != null && userSession.getUserId() == SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID)) { 82 return false; 83 84 } else if(remoteUser != null && !remoteUser.equals(userSession.getUsername())) { 86 return false; 87 } 88 return false; 89 } 90 } 91 | Popular Tags |