[DS-48] shibboleth+dspace1.5.1 patch - ID: 2412723 Commiting dspace3688-ignoreScope-v3.patch (3 kB)

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3713 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2009-04-13 20:22:35 +00:00
parent 3c99f49351
commit 4975bf1a67
2 changed files with 24 additions and 6 deletions

View File

@@ -226,6 +226,8 @@ public class ShibAuthentication implements AuthenticationMethod
java.util.Set groups = new java.util.HashSet();
String roleHeader = ConfigurationManager
.getProperty("authentication.shib.role-header");
boolean roleHeader_ignoreScope = ConfigurationManager
.getBooleanProperty("authentication.shib.role-header.ignore-scope");
if (roleHeader == null || roleHeader.trim().length() == 0)
roleHeader = "Shib-EP-UnscopedAffiliation"; // fall back to default
String affiliations = request.getHeader(roleHeader);
@@ -251,6 +253,13 @@ public class ShibAuthentication implements AuthenticationMethod
{
String affiliation = st.nextToken().trim();
// strip scope if present and roleHeader_ignoreScope
if (roleHeader_ignoreScope)
{
int index = affiliation.indexOf("@");
if (index != -1) affiliation = affiliation.substring(0,index);
}
// perform mapping here if necessary
String groupLabels = ConfigurationManager
.getProperty("authentication.shib.role." + affiliation);