Commit Graph

63 Commits

Author SHA1 Message Date
Meirza
b79231361b MDL-61789 auth_oauth2: Update profile fields based on data mapping.
After the user creation, the system must call an update function to update profile_fields_*.
We also provided two functions into user/profile/lib.php to get available from other areas.
We added PHP unit testing for new public functions and
the Behat tests for custom profile fields with locked and unlocked statuses.

Co-authored-by: Matt Porritt <matt.porritt@moodle.com>
2023-01-07 20:59:26 +07:00
Matt Porritt
6793891887 MDL-61789 auth_oauth2: Allow admin to choose profile fields for mapping
Update oauth2 to allow mapping of provider attributes against
user profile fields. Fields can also be locked to prevent
user changes.

Co-Authored-By: Michael Milette <michael.milette@tngconsulting.ca>
2023-01-06 13:27:11 +07:00
Tomo Tsuyuki
a6a7b16846 MDL-75171 Auth: extend user logged in event
Co-authored-by: Heena Agheda <heenaagheda@catalyst-au.net>
2022-08-19 18:38:59 +10:00
Kevin Pham
aeea0b1502 MDL-49795 auth_oauth2: Add missing metadata providers for oauth2 tables 2022-08-03 15:17:05 +10:00
Matt Porritt
1c77897523 MDL-59115 auth_oauth2: Set all mapped field of user
On account creation by Oauth2 all configured mapped user
fields are now saved in the user profile on user creation.

Co-Authored-By: SKOLL Learning Technologies
2021-12-01 03:16:19 +00:00
abgreeve
8a53fe7f6b Merge branch 'MDL-28452-master' of git://github.com/bmbrands/moodle 2021-04-22 09:38:50 +08:00
Bas Brands
f9e1c2587a MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:22:25 +02:00
Marina Glancy
0152fdbdff MDL-71017 oauth2: configure some oauth2 services for login only 2021-04-20 10:50:40 +02:00
Sander Wind
c9855a8b20 MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:44:24 +01:00
Mihail Geshoski
ecf15a63b4 MDL-60827 oauth2: Consider requireconfirmation setting on login 2020-07-06 10:04:42 +08:00
Mark Johnson
f3c9599e1f MDL-65335 auth: Make oauth2 enabled check more efficient 2019-09-20 08:54:40 +01:00
Jun Pataleta
09267294bd MDL-65918 auth_oauth2: Require profile library once
Thanks to Jason Grimes for the bug report and fix suggestion!
2019-07-23 10:11:17 +08:00
Shamim Rezaie
18641610d7 MDL-59298 auth_oauth2: Custom email message when account uses oauth2
AMOS BEGIN
 CPY [emailpasswordchangeinfosubject,core],[emailpasswordchangeinfosubject,auth_oauth2]
AMOS END
2019-04-08 18:56:41 +10:00
Andrew Nicols
568b7d3fc0 Merge branch 'MDL-64714-master' of git://github.com/cescobedo/moodle 2019-02-13 11:22:24 +08:00
Eloy Lafuente (stronk7)
f706dabd50 Merge branch 'MDL-63785-master' of git://github.com/rezaies/moodle 2019-02-06 00:04:14 +01:00
cescobedo
00b4f9e234 MDL-64714 core_auth: Fix early break foreach in delete_data_for_user 2019-02-05 12:51:34 +01:00
Jun Pataleta
e2b812fc40 MDL-64474 auth_oauth2: Properly update user profile data
* Updating of user profile data from OAuth2 issuer should only be
performed for fields that can be synced externally (fields defined in
\auth_plugin_base::$userfields)
* Only update user profile data for users which use OAuth2 as their
default authentication mechanism.
2018-12-28 16:52:37 +08:00
Andrew Nicols
c9f2a8c2cf MDL-61767 auth_oauth: Reduce updated fields 2018-12-19 18:15:39 +08:00
Martin Mastny
c65dadbcea MDL-61767 auth_oauth2: Updating user fields on successful login 2018-12-13 11:22:36 +08:00
Shamim Rezaie
e68a25f395 MDL-63785 auth_oauth2: performance improvement 2018-12-10 14:52:12 +11:00
Mihail Geshoski
60f3eec644 MDL-63592 auth_oauth2: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:50:13 +02:00
Mark Nelson
df1714f25a MDL-62228 core: remove unnecessary context check in privacy providers 2018-05-14 18:33:29 +08:00
Mihail Geshoski
b1add54344 MDL-62384 privacy: Modify user contexts query for auth_oauth2 2018-05-11 09:46:29 +08:00
cescobedo
21ae044620 MDL-61882 auth_oauth2: Implement Privacy API 2018-04-23 17:34:30 +02:00
David Mudrák
6cc9dce202 MDL-60101 auth_oauth2: Don't allow suspended users to SSO in via OAuth2
Without this patch, users could still log in as a suspended account via
OAuth2 SSO feature.
2018-03-13 10:14:00 +01:00
John Okely
7eb50b3290 MDL-42834 admin: Remove wwwroot if used with moodle_url 2017-10-23 12:25:36 +08:00
John Okely
672f483670 MDL-42834 admin: Removal of httpswwwroot 2017-10-23 12:25:36 +08:00
Dan Poltawski
04d1f77644 Merge branch 'MDL-58544-master' of git://github.com/damyon/moodle 2017-07-10 08:36:40 +01:00
Damyon Wiese
859e2033cb MDL-58544 oauth2: Allow trusted issuers
Add a setting to each issuer that skips the email confirmation when creating and linking accounts.
2017-06-27 16:50:27 +08:00
Simey Lameze
92c8cb9d98 MDL-59275 auth: prevent user login failed coding error 2017-06-27 13:04:02 +08:00
Jun Pataleta
e037a6a126 Merge branch 'MDL-59012-master-linkurl' of git://github.com/mudrd8mz/moodle 2017-06-14 12:32:03 +01:00
Jun Pataleta
1ff50be21f Merge branch 'MDL-58908-master' of git://github.com/damyon/moodle 2017-06-06 17:15:41 +08:00
David Mudrák
97cc7e0969 MDL-59012 auth_oauth2: Do not escape URL in plain text emails 2017-05-23 13:28:27 +02:00
David Monllao
011591a148 MDL-58905 auth_oauth2: No linked accounts if the plugin is not enabled 2017-05-12 14:36:01 +08:00
Andrew Nicols
2c69d24037 Merge branch 'MDL-58898-master' of https://github.com/xow/moodle 2017-05-12 12:32:23 +08:00
John Okely
4c8727bad6 MDL-58898 oauth: Remove orphaned linked logins 2017-05-12 12:18:17 +08:00
Damyon Wiese
95e13556df MDL-58908 auth_oauth2: Don't kill gravatar
If gravatar is enabled, don't update profile pictures.
2017-05-12 11:43:47 +08:00
Andrew Nicols
95dd5e3bd6 MDL-58774 auth_oauth2: Only check unexpired accounts for same issuer
It shoudl be possible to link multiple OAuth2 sources which have the
same e-mail address to an account.

This patch makes the check for an existing linked account stricter so
that it only checks for linked account records which match the same
issuer, and which do not have expired confirmation tokens.
2017-05-12 09:44:48 +08:00
Damyon Wiese
4f705f5d0d MDL-58774 auth_oauth2: Prevent duplicate linked logins 2017-05-10 10:17:56 +08:00
Damyon Wiese
e0abc2e405 MDL-58774 auth_oauth2: Cleanup on user delete. 2017-05-08 14:26:44 +08:00
David Mudrák
1cb5c7b31f MDL-58631 auth: Clarify documentation of changes in loginpage_idp_list()
This should clarify the new 'iconurl' key returned by the auth plugin's
loginpage_idp_list() method.
2017-04-18 17:00:40 +02:00
David Monllao
bb17eafab0 Merge branch 'MDL-58478-master' of git://github.com/damyon/moodle 2017-04-17 14:44:39 +02:00
Damyon Wiese
427fa27cf4 MDL-58220 auth_oauth2: Fix login domains
The login domains were checking the email of the moodle account, not the returned
email from oauth. Also after a failure, it was not killing the oauth session, which
prevents you trying again with a different account.
2017-04-06 11:35:02 +08:00
Damyon Wiese
f331513347 MDL-58220 auth_oauth2: Fix for login via linked login
This was broken by the refactoring to always link logins. Some of the static
variables could also be removed but I'll do that in a later issue to keep this patch small.
2017-04-05 15:55:53 +08:00
Damyon Wiese
a647e7d762 MDL-58220 oauth2: missing param confirmtokenexpires 2017-04-05 14:42:22 +08:00
Damyon Wiese
6cee96c8af MDL-58220 oauth2: obey $CFG->authpreventaccountcreation 2017-04-05 12:52:32 +08:00
Damyon Wiese
46d5582ec9 MDL-58478 oauth2: Use real admin settings
This is an upgrade to real admin settings to comply with MDL-12689
2017-04-04 14:37:13 +08:00
Damyon Wiese
512e681a3b MDL-58220 oauth2: Don't login as deleted users
Also prevent sesskey error on first page of new logins.
2017-04-03 13:43:27 +08:00
Damyon Wiese
7f15866006 MDL-58220 oauth2: Use email as default username
And give better error messages.
2017-04-03 13:43:27 +08:00
Damyon Wiese
c45d4b6a73 MDL-58220 oauth2: Change $OUTPUT to $this 2017-04-03 13:43:26 +08:00