diff --git a/auth_token/server/JaasSupport/src/com/novell/casa/jaas/sample/SampleApp.java b/auth_token/server/JaasSupport/src/com/novell/casa/jaas/sample/SampleApp.java index 7fd1a437..0cd43c85 100644 --- a/auth_token/server/JaasSupport/src/com/novell/casa/jaas/sample/SampleApp.java +++ b/auth_token/server/JaasSupport/src/com/novell/casa/jaas/sample/SampleApp.java @@ -123,7 +123,24 @@ public class SampleApp while (enumeration.hasMore()) { System.out.print(" Attribute Name: " + attr.getID()); - System.out.println(" :: Attribute Value: " + (String) enumeration.next()); + Object attrValue = enumeration.next(); + if (attrValue instanceof byte[]) + { + // The attribute value is binary data + StringBuffer buf = new StringBuffer(); + char[] hex = "0123456789ABCDEF".toCharArray(); + for (int i = 0; i < ((byte[]) attrValue).length; i++) + { + buf.append(hex[(((byte[]) attrValue)[i] >> 4) & 0xF]); + buf.append(hex[((byte[]) attrValue)[i] & 0xF]); + } + System.out.println(" :: Attribute Value: " + buf.toString()); + } + else + { + // The attribute value is contained in a string + System.out.println(" :: Attribute Value: " + (String) attrValue); + } } } }