CAS username field value to be manually added to the existing user on import? I installed the CAS module on a Drupal 8 site, and it is working fine. For new users, it auto-registers the user with cas_username, but I would like to import the cas_username manually for the existing Drupal 8 user.

I also tried importing users in CSV format; I have been able to add the $account(row[0],row1), but for the CAS username import, i don't know how to import it, and in which field is stored.

'uid' =&gt; NULL,
'name' =&gt; $username,
'field_first_name' =&gt; row[0],
'field_last_name' =&gt; $row[1],
'pass' =&gt; $username,
'mail' =&gt; $row[2],
'status' =&gt; 1,
'created' =&gt; REQUEST_TIME,
'roles' =&gt; array_values($config['roles']), 


I tried Managing CAS username; the suggestion given is for Drupal 7, but the same method doesn't work for Drupal 8.

How do I import the CAS username in CSV?
I find out the solution for the CAS_username import in CSV method. The method of db_insert in (authmap) table, which dynamically insert the CAS_username in respective field.

The authmap table is present in external authentication module.

    db_insert('authmap')
    -&gt;fields(array(
     'uid' =&gt; $uid,
     'provider' =&gt; 'cas',
     'authname' =&gt; $row[0],
     'data' =&gt; 'N;',
     ))
    -&gt;execute();


So this is the method, i dynamically update the CAS_username using CSV. If any suggestions or update in that. Kindly Prescribe it.