Skip to content

Commit

Permalink
Merge pull request #9461 from PaulBoon/8573-Shib-attribute-character-…
Browse files Browse the repository at this point in the history
…set-conversion-for-affiliation

Add Shib attribute characterset conversion to getValueFromAssertion
  • Loading branch information
ofahimIQSS authored Nov 6, 2024
2 parents 62d6aa6 + 0daa077 commit b28812b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/Shib.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,9 @@ private String getValueFromAssertion(String key) {
Object attribute = request.getAttribute(key);
if (attribute != null) {
String attributeValue = attribute.toString();
if(systemConfig.isShibAttributeCharacterSetConversionEnabled()) {
attributeValue = new String(attributeValue.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
}
String trimmedValue = attributeValue.trim();
if (!trimmedValue.isEmpty()) {
logger.fine("The SAML assertion for \"" + key + "\" (optional) was \"" + attributeValue + "\" and was trimmed to \"" + trimmedValue + "\".");
Expand Down

0 comments on commit b28812b

Please sign in to comment.