Skip to content

Commit b28812b

Browse files
authored
Merge pull request #9461 from PaulBoon/8573-Shib-attribute-character-set-conversion-for-affiliation
Add Shib attribute characterset conversion to getValueFromAssertion
2 parents 62d6aa6 + 0daa077 commit b28812b

File tree

1 file changed

+3
-0
lines changed
  • src/main/java/edu/harvard/iq/dataverse

1 file changed

+3
-0
lines changed

src/main/java/edu/harvard/iq/dataverse/Shib.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ private String getValueFromAssertion(String key) {
421421
Object attribute = request.getAttribute(key);
422422
if (attribute != null) {
423423
String attributeValue = attribute.toString();
424+
if(systemConfig.isShibAttributeCharacterSetConversionEnabled()) {
425+
attributeValue = new String(attributeValue.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
426+
}
424427
String trimmedValue = attributeValue.trim();
425428
if (!trimmedValue.isEmpty()) {
426429
logger.fine("The SAML assertion for \"" + key + "\" (optional) was \"" + attributeValue + "\" and was trimmed to \"" + trimmedValue + "\".");

0 commit comments

Comments
 (0)