Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: DSpace/DSpace
...
head fork: DSpace/DSpace
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Feb 07, 2014
@pnbecker pnbecker DS-1906: Adds configurable option to reconvert shibboleth attributes. 7e6b805
Commits on Mar 06, 2014
@pnbecker pnbecker Reconvert shibboleth attribute only if it is neither null nor empty. c6016c8
Commits on Jul 03, 2014
@hardyoyo hardyoyo Merge pull request #469 from tuub/DS-1906
DS-1906: Adds configurable option to reconvert shibboleth attributes.
ec06834
View
17 dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java
@@ -26,6 +26,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Level;
import javax.servlet.http.HttpServletResponse;
@@ -1094,6 +1095,22 @@ private String findAttribute(HttpServletRequest request, String name) {
value = request.getHeader(name.toLowerCase());
if (StringUtils.isEmpty(value))
value = request.getHeader(name.toUpperCase());
+
+ boolean reconvertAttributes =
+ ConfigurationManager.getBooleanProperty(
+ "authentication-shibboleth",
+ "reconvert.attributes",
+ false);
+
+ if (!StringUtils.isEmpty(value) && reconvertAttributes)
+ {
+ try {
+ value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
+ } catch (UnsupportedEncodingException ex) {
+ log.warn("Failed to reconvert shibboleth attribute ("
+ + name + ").", ex);
+ }
+ }
return value;
}
View
6 dspace/config/modules/authentication-shibboleth.cfg
@@ -137,6 +137,12 @@ lastname-header = SHIB-SURNAME
# If the eperson metadata field is not found, should it be automatically created?
eperson.metadata.autocreate = true;
+# Shibboleth attributes are by default UTF-8 encoded. Some servlet container
+# automatically converts the attributes from ISO-8859-1 (latin-1) to UTF-8.
+# As the attributes already were UTF-8 encoded it may be necessary to reconvert
+# them. If you detect problems with special characters in shibboleth attributes
+# set this to true (default to false).
+reconvert.attributes = false
##
## Role-based Groups:

No commit comments for this range

Something went wrong with that request. Please try again.