diff --git a/modules/smartnameattribute/lib/Auth/Process/SmartName.php b/modules/smartnameattribute/lib/Auth/Process/SmartName.php
index <HASH>..<HASH> 100644
--- a/modules/smartnameattribute/lib/Auth/Process/SmartName.php
+++ b/modules/smartnameattribute/lib/Auth/Process/SmartName.php
@@ -21,6 +21,11 @@ class sspmod_smartnameattribute_Auth_Process_SmartName extends SimpleSAML_Auth_P
 		if (isset($attributes['displayName']))
 			return $attributes['displayName'][0];
 		
+		if (isset($attributes['cn'])) {
+			if (count(explode(' ', $attributes['cn'][0])) > 1)
+				return $attributes['cn'][0];
+		}
+		
 		if (isset($attributes['sn']) && isset($attributes['givenName']))
 			return $attributes['givenName'][0] . ' ' . $attributes['sn'][0];
use cn if contains multiple parts