[DS-998] - Shibboleth login - improve handling of empty attribute headers

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6559 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2011-08-18 21:35:03 +00:00
parent 61d578d009
commit ac0da66b31

View File

@@ -71,21 +71,21 @@ public class ShibAuthentication implements AuthenticationMethod
email = request.getHeader(emailHeader);
// fail, try lower case
if (email == null)
if (email == null || "".equals(email))
{
email = request.getHeader(emailHeader.toLowerCase());
}
}
// try to pull the "REMOTE_USER" info instead of the header
if (email == null && isUsingTomcatUser)
if ( (email == null || "".equals(email)) && isUsingTomcatUser)
{
email = request.getRemoteUser();
log.info("RemoteUser identified as: " + email);
}
// No email address, perhaps the eperson has been setup, better check it
if (email == null)
if (email == null || "".equals(email))
{
EPerson p = context.getCurrentUser();
if (p != null)
@@ -94,7 +94,7 @@ public class ShibAuthentication implements AuthenticationMethod
}
}
if (email == null)
if (email == null || "".equals(email))
{
log
.error("No email is given, you're denied access by Shib, please release email address");