Skip to content

Commit

Permalink
[DS-48] shibboleth+dspace1.5.1 patch - ID: 2412723 Commiting dspace36…
Browse files Browse the repository at this point in the history
…88-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
  • Loading branch information
mdiggory committed Apr 13, 2009
1 parent 3c99f49 commit 4975bf1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
Expand Up @@ -226,6 +226,8 @@ public int[] getSpecialGroups(Context context, HttpServletRequest request)
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);
Expand All @@ -251,6 +253,13 @@ public int[] getSpecialGroups(Context context, HttpServletRequest request)
{
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);
Expand Down
21 changes: 15 additions & 6 deletions dspace/config/dspace.cfg
Expand Up @@ -318,13 +318,22 @@ authentication.shib.email-use-tomcat-remote-user = true
# if the IdP provides sufficient info (and user not exists in DSpace)
authentication.shib.autoregister = true

# this header here specifies which attribute that is responsible
# for providing user's roles to DSpace. When not specified, it is
# defaulted to 'Shib-EP-UnscopedAffiliation'. The value is specified
# in AAP.xml (Shib 1.3.x) or attribute-filter.xml (Shib 2.x).
# The value is CASE-Sensitive. The values provided in this
# header are separated by semi-colon or comma.
# these two header here specify which attribute that is responsible
# for providing user's roles to DSpace and unscope the attributes if needed.
# When not specified, it is defaulted to 'Shib-EP-UnscopedAffiliation', and
# ignore-scope is defaulted to 'false'.
# The value is specified in AAP.xml (Shib 1.3.x) or
# attribute-filter.xml (Shib 2.x). The value is CASE-Sensitive.
# The values provided in this header are separated by semi-colon or comma.
# If your sp only provides scoped role header, you need to set
# authentication.shib.role-header.ignore-Scope as true.
# for example if you only get Shib-EP-ScopedAffiliation instead of Shib-EP-ScopedAffiliation,
# you have to make your setting as:
# authentication.shib.role-header = Shib-EP-ScopedAffiliation
# authentication.shib.role-header.ignore-scope = true

# authentication.shib.role-header = Shib-EP-UnscopedAffiliation
authentication.shib.role-header.ignore-scope = false

# when user is fully authN on IdP but would not like to release
# his/her roles to DSpace (for privacy reason?), what should be
Expand Down

0 comments on commit 4975bf1

Please sign in to comment.