How to encode Active Directory objctGUID to a readble string?

Product/components used and version/fix level:

webMethods 10.15

Detailed explanation of the problem:

I can rertieve all the user Data from our AD and the objectGUID is in an unreadable format.

Like this: ������M�a�C��u

i put this into pub.string:string to bytes
[B@3df42815

after that i put this into pub.string.base64Encode
Pz8/Pz8VP00/BxQ/Qz8/dQ==

after that i put it into this java service:

```
          IDataCursor pipelineCursor = pipeline.getCursor();
			String	inString = IDataUtil.getString( pipelineCursor, "inString" );
				
			pipelineCursor.destroy();
	
	byte[] decodedBytes = Base64.getDecoder().decode(inString);
	
	// Convert byte array to UUID
	long mostSigBits = 0;     
	long leastSigBits = 0;
	for (int i = 0; i < 8; i++) {
	mostSigBits = (mostSigBits << 8) | (decodedBytes[i] & 0xff);
	}
	for (int i = 8; i < 16; i++) {
	leastSigBits = (leastSigBits << 8) | (decodedBytes[i] & 0xff);
	}
	UUID uuid = new UUID(mostSigBits, leastSigBits);
	
	// System.out.println("Decoded UUID: " + uuid.toString());
	
	String objectGUID = uuid.toString();
	
	// pipeline
	IDataCursor pipelineCursor_1 = pipeline.getCursor();
	IDataUtil.put( pipelineCursor_1, "objectGUID", objectGUID );
	pipelineCursor_1.destroy();
}

´´´
i got this, but this is not the correct objectGUID of this User.

3f3f3f3f-3f15-3f4d-3f07-143f433f3f75

The correct one is

A9FAC0CD-1580-4D86-8407-1481438DAA75

it looks different.

How i can retrieve the correct objectGUID from active directory???

Hi Martin,

might it be that the directory returns the GUID in a somehow already coded manner, which needs to be decoded first before base64-encoding it?

Regards,
Holger

Hello Holger,

the objectGUID ist BASE64 coded and I retrieve it with pub.client.ldap:search as string.

objectGUID = �����_�M�__�C��u

That i need as readable string.

Regards

Martin