Oauth2 Moodle sign up

Re: Oauth2 Moodle sign up

by Ken Task -
Number of replies: 1
Picture of Particularly helpful Moodlers

I'll start by saying 'what we want to do isn't always available - workarounds included!' - and to go along with that ... there are good reasons!

You probably need to look at what's there already and why ...

Guest account already exist ... profile can't/shouldn't be edited by a guest user themselves.   Using any mysql tool you have query the mdl_user table 

mysql> select id,username,firstname,lastname,password,email from mdl_user where id=1;

You'll see that the guest user was the first user created and even though you might see a password it is hashed, etc. and it shouldn't be changed.  Email address is root@localhost ... good!  Don't want a guest user to become spam king/queen in your site!

For guest user to see courses, courses themselves must allow guest access in defining parameters of a course.  And Guest user cannot use any activity/mod/block or whatever that's interactive or allows input like posting to a forum or uploading a file, etc.

All users using Google's Oauth2 ... is fine ... just not Guest and the first person to install the moodle instance ... if left for defaults, user is 'admin'.

Can't emphasize this enough ... at least one user needs to ability to login manually ... ie, that username/password in left panel of the login screen.  IF all the other authentications fail for some reason, manual admin account will be the only user who can login.

Persons do use Google configured for handling mail for a domain ... ie, not all Google email is @gmail.com.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Oauth2 Moodle sign up

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Alessandro,

When you say 'Allow new people to sign up as guests', I'm guessing that you want new users to have an account and not just be logged in as a guest, right?

You can disable all login possibilities except Google OAuth by just enabling OAuth 2 authentication and setting up the OAuth 2 Google service only.

You can then choose whether new people will have an account created for them automically or not, by disabling or enabling the setting 'Prevent account creation when authenticating' in Site admin / Plugins / Authentication / Manage authentication.