mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
[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:
@@ -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");
|
||||
|
Reference in New Issue
Block a user