diff --git a/config-templates/config.php b/config-templates/config.php
index cbbf74c1b6224cc370429999eee6bb4f76a5eb2e..c52d1a96c44418a2e3e2409949b718bd35e8256d 100644
--- a/config-templates/config.php
+++ b/config-templates/config.php
@@ -191,12 +191,15 @@ $config = array (
 		),
 
 
-	/*
+	/**
 	 * LDAP configuration. This is only relevant if you use the LDAP authentication plugin.
+	 *
+	 * The attributes parameter is a list of attributes that should be retrieved.
+	 * If the attributes parameter is set to null, all attributes will be retrieved.
 	 */
 	'auth.ldap.dnpattern'  => 'uid=%username%,dc=feide,dc=no,ou=feide,dc=uninett,dc=no',
 	'auth.ldap.hostname'   => 'ldap.uninett.no',
-	'auth.ldap.attributes' => 'objectclass=*',
+	'auth.ldap.attributes' => null,
 	
 	/*
 	 * Radius authentication. This is only relevant if you use the Radius authentication plugin.
diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index 62b423bbd1c70121b16c941e405aa377cbc5bf9b..854bace4b6209d75f59b7f78c97fac1e2dcfb65f 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -102,7 +102,7 @@ class SimpleSAML_Auth_LDAP {
 		$searchtxt = (is_array($attributes) ? join(',', $attributes) : 'all attributes');
 		SimpleSAML_Logger::debug('Library - LDAP: Get attributes from ' . $dn . ' (' . $searchtxt . ')');
 		
-		if (is_array($search)) 
+		if (is_array($attributes)) 
 			$sr = @ldap_read($this->ldap, $dn, 'objectClass=*', $attributes );
 		else 
 			$sr = @ldap_read($this->ldap, $dn, 'objectClass=*');
diff --git a/www/auth/login.php b/www/auth/login.php
index 8d86828c3aeae0f997ee15c8ef3ceea23d35ecd1..ea5b4e5796ad8fcefda8f2bbfb2fdb4ac8ea7fda 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -3,18 +3,13 @@
 
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . '../../www/_include.php');
 
-
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Utilities.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Session.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Metadata/MetaDataStorageHandler.php');
-require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/XML/SAML20/AuthnRequest.php');
-require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Bindings/SAML20/HTTPRedirect.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/XHTML/Template.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Logger.php');
-
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Auth/LDAP.php');
 
-
 $config = SimpleSAML_Configuration::getInstance();
 $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 $session = SimpleSAML_Session::getInstance(true);
@@ -22,7 +17,6 @@ $session = SimpleSAML_Session::getInstance(true);
 SimpleSAML_Logger::info('AUTH  - ldap: Accessing auth endpoint login');
 
 
-
 $error = null;
 $attributes = array();
 $username = null;