[java-plugin-shibd] branch main updated: Handle byte values with Base64 encoding.

Scott Cantor cantor.2 at osu.edu
Thu Apr 17 13:56:43 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-plugin-shibd.

View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd.git;a=commit;h=88413ade500986ad0976d92c97c78f0f3d6822be

The following commit(s) were added to refs/heads/main by this push:
     new 88413ad  Handle byte values with Base64 encoding.
88413ad is described below

commit 88413ade500986ad0976d92c97c78f0f3d6822be
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Apr 17 09:56:37 2025 -0400

    Handle byte values with Base64 encoding.
---
 .../sp/profile/AbstractTokenConsumerResponseAction.java           | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java b/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
index 0c15e60..92b0400 100644
--- a/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
+++ b/sp-server-api/src/main/java/net/shibboleth/sp/profile/AbstractTokenConsumerResponseAction.java
@@ -32,6 +32,8 @@ import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
 import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.context.AttributeContext;
+import net.shibboleth.shared.codec.Base64Support;
+import net.shibboleth.shared.codec.EncodingException;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.sp.context.AgentRequestContext;
@@ -119,7 +121,11 @@ public abstract class AbstractTokenConsumerResponseAction extends AbstractApplic
                     } else if (value instanceof DateTimeAttributeValue datetime) {
                         obj.add(new DDF(null).longinteger(datetime.getValue().getEpochSecond()));
                     } else if (value instanceof ByteAttributeValue bytes) {
-                        obj.add(new DDF(null).unsafe_string(bytes.getValue()));
+                        try {
+                            obj.add(new DDF(null).string(Base64Support.encode(bytes.getValue(), false)));
+                        } catch (final EncodingException e) {
+                            log.warn("{} Error base64-encoding ByteAttributeValue", getLogPrefix(), e);
+                        }
                     } else {
                         log.warn("{} Unsupported attribute value type: {}", getLogPrefix(), value.getClass().getName());
                     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list