diff --git a/lib/ilias_interface/ConnectedIlias.class.php b/lib/ilias_interface/ConnectedIlias.class.php
index 6b827839a68726db5a531a08b394b2272bc27dca..09e15076bd0d281d8c86631f13bd40f302149d0f 100644
--- a/lib/ilias_interface/ConnectedIlias.class.php
+++ b/lib/ilias_interface/ConnectedIlias.class.php
@@ -325,7 +325,6 @@ class ConnectedIlias
         }
         $user_data = $this->user->getUserArray();
         $user_data["login"] = $this->ilias_config['user_prefix'].$user_data["login"];
-        $user_data['auth_mode'] = 'default';
 
         $user_exists = $this->soap_client->lookupUser($user_data["login"]);
         //automatische Zuordnung von bestehenden Ilias Accounts
@@ -351,10 +350,18 @@ class ConnectedIlias
             ($this->user->auth_plugin != 'standard') &&
             ($this->user->auth_plugin == $this->ilias_config['ldap_enable'])) {
             $user_data['external_account'] = $this->user->studip_login;
+            $auth_plugin = StudipAuthAbstract::getInstance($this->user->auth_plugin);
+            if ($auth_plugin instanceof StudipAuthLdap) {
+                $user_data['auth_mode'] = 'ldap';
+            } elseif ($auth_plugin instanceof StudipAuthCAS) {
+                $user_data['auth_mode'] = 'cas';
+            } elseif ($auth_plugin instanceof StudipAuthShib) {
+                $user_data['auth_mode'] = 'shibboleth';
+            }
         }
 
         // set role according to Stud.IP perm
-        if ($GLOBALS['auth']->auth['perm'] === 'root') {
+        if (User::findCurrent()->perms === 'root') {
             $role_id = 2;
         } else {
             $role_id = 4;
@@ -405,7 +412,6 @@ class ConnectedIlias
         if ($update_user->isConnected() && $update_user->id && $this->soap_client->lookupUser($update_user->login)) {
             $user_data = $update_user->getUserArray();
             $user_data["login"] = $this->ilias_config['user_prefix'].$user_data["login"];
-            $user_data['auth_mode'] = 'default';
 
             // set role according to Stud.IP perm
             if ($user->perms == "root") {
diff --git a/lib/ilias_interface/IliasUser.class.php b/lib/ilias_interface/IliasUser.class.php
index 6ee980ab671173b2fd8d7e136df10808cb696432..5737e65b8f3b1ffcca3820890092c4a3e1682734 100644
--- a/lib/ilias_interface/IliasUser.class.php
+++ b/lib/ilias_interface/IliasUser.class.php
@@ -169,22 +169,24 @@ class IliasUser
     function getUserArray()
     {
         // data for user-account in ILIAS
-        $user_data["id"] = $this->id;
-        $user_data["login"] = $this->studip_login;
-        $user_data["passwd"] = $this->external_password;
-        $user_data["firstname"] = $this->firstname;
-        $user_data["lastname"] = $this->lastname;
-        $user_data["title"] = $this->title;
-        $user_data["gender"] = $this->gender;
-        $user_data["email"] = $this->email;
-        $user_data["street"] = $this->street;
-        $user_data["phone_home"] = $this->phone_home;
-        $user_data["matriculation"] = $this->matriculation;
-        $user_data["time_limit_unlimited"] = 1;
-        $user_data["active"] = 1;
-        $user_data["approve_date"] = date('Y-m-d H:i:s');
-        $user_data["accepted_agreement"] = true;
-        $user_data["agree_date"] = date('Y-m-d H:i:s');
+        $user_data['id'] = $this->id;
+        $user_data['login'] = $this->studip_login;
+        $user_data['passwd'] = $this->external_password;
+        $user_data['firstname'] = $this->firstname;
+        $user_data['lastname'] = $this->lastname;
+        $user_data['title'] = $this->title;
+        $user_data['gender'] = $this->gender;
+        $user_data['email'] = $this->email;
+        $user_data['street'] = $this->street;
+        $user_data['phone_home'] = $this->phone_home;
+        $user_data['matriculation'] = $this->matriculation;
+        $user_data['time_limit_unlimited'] = 1;
+        $user_data['active'] = 1;
+        $user_data['approve_date'] = date('Y-m-d H:i:s');
+        $user_data['accepted_agreement'] = true;
+        $user_data['agree_date'] = date('Y-m-d H:i:s');
+        $user_data['auth_mode'] = 'default';
+        $user_data['external_account'] = '';
         return $user_data;
     }