CAS sync doesn't add any users

CAS sync doesn't add any users

by Eric Phetteplace -
Number of replies: 0

Hi all, hope you can help me set up CAS user sync. We use auth db right now to populate the users table but then run a script to change them all to "CAS" for signing in. Our setup technically works but there is one problem: users sometimes have a CAS account before they're in the auth db. If they sign in during this window, Moodle creates an empty profile of uneditable fields (name, email, etc.) that brickwalls the user until I manually fix it. These "ghost" users are easy to spot via Browse Users because they have no name:

two ghost users in Moodle

We should be syncing users directly from LDAP or CAS because it circumvents this problem and simplifies our integrations. But I tried to run the "\auth_cas\task\sync_task" task on a dev server however, with SSO settings that seem functional because I can sign in, but it did not create any new users:

Execute scheduled task: CAS users sync job (auth_cas\task\sync_task)
Connecting to LDAP server...
Creating temporary table tmp_extuser
Did not get any users from LDAP -- error? -- exiting
... used 4 dbqueries
... used 0.052947044372559 seconds
Scheduled task complete: CAS users sync job (auth_cas\task\sync_task)

When I test our CAS settings, I get a warning "empty context found" but also the message "Connecting to your LDAP server was successful".

Similarly, after adding LDAP settings copied from our CAS configuration and enabling the LDAP authentication plugin, the corresponding LDAP sync doesn't work:

Execute scheduled task: LDAP users sync job (auth_ldap\task\sync_task)
Connecting to LDAP server...
Creating temporary table tmp_extuser
Did not get any users from LDAP -- error? -- exiting
... used 4 dbqueries
... used 0.044350862503052 seconds
Scheduled task complete: LDAP users sync job (auth_ldap\task\sync_task)

So now I'm at a loss, unfortunately. What could I be missing? Our CAS auth works users can sign in, it's just that the user sync doesn't. I assume there is some particular setting, perhaps related to this context error, that I need to have our campus IT help me fill out.
Average of ratings: -