Sep 26th, 2006, 02:32 AM
Retrieve OctetString attribute with DirContextAdapter causes class cast exception
When using Sun Directory Server, retrieving an OctetString (such as a hashed password) attribute using DirContextAdapter.getStringAttribute() causes a class cast exception. This is because OctetString are in fact returned as byte.
I worked around this by extending DirContextAdapter and adding a [ExtendedDirContextAdapter].getOctetStringAttribute() method. . . . at least this is what I'm about to do Perhaps this is a bit sucky.
Maybe DirContextAdapter could support different attribute types (GeneralizedTime, DirectoryString, OctetString, etc) ?
Sep 26th, 2006, 02:38 AM
Oops: Found getObjectAttribute.