Single Sign On is enabled on our Canvas. So any student with our email can login into Canvas without any username and password.
The users that this process creates on Canvas don't get user_id (sis id). Their SIS_ID will be blank on Canvas.
When we create users by csv files we put their student number as their sis id. This creates duplicate user accounts for them on Canvas. One with sis_id and the other one without it.
We have to merge them later on one by one. It is very annoying.
How can this be solved?
Every User on Canvas has an associated Login. So 1 user account can have 1 or multiple logins. That means, a user can use multiple login credentials from different gateways to access the same account. For ex: the user Canvas Neil has two separate logins.
Note that the user_sis_id identifier is associated with the Login. This can be updated from the UI and also the Canvas API.
Your SSO process creates a user account along with a login, which does not have an SIS ID. So instead of creating a new account and then merging, you can simply update the SIS ID of the login that is created by the SSO with your desired student id.
To update the SIS IDs in bulk, you will have to use the Edit a user login resource. Here are some brilliant resources that will help you get started with the Canvas API:
Hope this helps!