diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index 59cbeb217d4572cc785d3797fb6dddcbe4425a46..10f836fae3ccfbbfdd0aca0cfe9490c7735c3dfe 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -373,7 +373,7 @@ class SimpleSAML_Auth_LDAP {
                 // decide whether to base64 encode or not
                 for ($k = 0; $k < $attribute['count']; $k++) {
                     // base64 encode binary attributes
-                    if (strtolower($name) === 'jpegphoto') {
+                    if (strtolower($name) === 'jpegphoto' || strtolower($name) === 'objectguid') {
                         $results[$i][$name][$k] = base64_encode($attribute[$k]);
                     }
                 }
@@ -541,8 +541,8 @@ class SimpleSAML_Auth_LDAP {
 					continue;
 				}
 
-				// Base64 encode jpegPhoto.
-				if (strtolower($name) === 'jpegphoto') {
+				// Base64 encode binary attributes.
+				if (strtolower($name) === 'jpegphoto' || strtolower($name) === 'objectguid') {
 					$values[] = base64_encode($value);
 				} else
 					$values[] = $value;