Index: lams_central/src/java/org/lamsfoundation/lams/web/ShibLoginServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/Attic/ShibLoginServlet.java,v diff -u -r1.1.2.6 -r1.1.2.7 --- lams_central/src/java/org/lamsfoundation/lams/web/ShibLoginServlet.java 12 Jul 2007 06:25:36 -0000 1.1.2.6 +++ lams_central/src/java/org/lamsfoundation/lams/web/ShibLoginServlet.java 13 Jul 2007 02:28:53 -0000 1.1.2.7 @@ -95,7 +95,8 @@ User user = service.getUserByLogin(prefixedUsername); if (user != null) { - // user is authenticated by Shibboleth IdP + // user is already authenticated by Shibboleth IdP + log.debug("Found account for shibboleth user "+username+", logging them in..."); response.sendRedirect("j_security_check?j_username="+prefixedUsername+"&j_password="+user.getPassword()); } else { // create user account for new shib user; @@ -159,8 +160,13 @@ // produces a local version of shibboleth user's username; it is prefixed by the fedId of their origin server private String getUsername(String username, String providerId) throws FederationException { + String host = getHost(providerId); + // check if user is from local server + if (host.equals(getHost(Configuration.get(ConfigurationKeys.SERVER_URL)))) { + log.debug("Shibboleth user "+username+" appears to be a local user."); + return username; + } try { - String host = getHost(providerId); FederationServer fedServer = fedService.getFedServerByURLHost(host); if (fedServer != null) { log.debug("Shibboleth user "+username+" appears to come from fedServer with fedId "+fedServer.getFedId());