first time login on moodle from CAS auth error Moodle 3.10.3+ (Build: 20210427)

first time login on moodle from CAS auth error Moodle 3.10.3+ (Build: 20210427)

by shpetim aliaj -
Number of replies: 3

Hi Guys,


This question is on a new thread here, as i posted on my previous thread but it deserves one on its own.

The issue i am facing on moodle  Moodle 3.10.3+ (Build: 20210427)

After setting cas auth and binding the ldap user to get the properties. I tried to login first time on moodle as a user from CAS auth and i got an error , but the ticket is created on cas server from the logs there.

Also after that,  I logged in with ldap "i have MFA enabled" and then changed the auth to ldap and I could login using cas.

Does someone knows where can i fix this?

Tim

Average of ratings: -
In reply to shpetim aliaj

Re: first time login on moodle from CAS auth error Moodle 3.10.3+ (Build: 20210427)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
What is the error? What does I have MFA enabled mean? What authentication method is selected before you change it?
In reply to Emma Richardson

Re: first time login on moodle from CAS auth error Moodle 3.10.3+ (Build: 20210427)

by shpetim aliaj -
Hi Emma,

Thanks a lot for you help.
My fault typing MFA i meant Multi-authentication under Site administration/Plugins/Authentication/CAS server (SSO) so i could have LDAP and CAS in case CAS did not work.


I have "Multi-authentication auth_cas | multiauth" set to yes

I tried to login using CAS authentication for the first time to test it with MA on, and i got an error "i do not remember the full line". it was something like invalid password. the same one moodle gives when user is set for ldap auth and it trying to login with CAS

Anyway I got the error from the logs:
The error is the ID"3" Login failed for user '#######'. Most likely the password did not match (error ID '3').

After that failed login attempt, i tried the standard ldap auth from the login page and it worked. I was logged in and the account was created on moodle. Then i changed the auth from LDAP to CAS for the user and logged out. On login using CAS auth it worked.

I traced the first attempt on cas server and i could see the ticket being generated OK and the user being authenticated.

Maybe moodle is having troubles creating a new user when the auth method is set to CAS (SSO) with MA and the user is not on the moodle database.

The issue is i am going to have some students login in the future and if user creation is not working on first login via CAS it will be tough.


=Tim
In reply to shpetim aliaj

Re: first time login on moodle from CAS auth error Moodle 3.10.3+ (Build: 20210427)

by shpetim aliaj -
It states here for the value of "Prevent account creation when authenticating" :

When a user authenticates, an account on the site is automatically created if it doesn't yet exist. If an external database, such as LDAP, is used for authentication, but you wish to restrict access to the site to users with an existing account only, then this option should be enabled. New accounts will need to be created manually or via the upload users feature. Note that this setting doesn't apply to MNet authentication.

I have that box unchecked and when auth via cas and ticket is created on cas and sent to moodle the account is not created even if the auth is OK.

Tim