Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
47c6484
Populate iconurl with a real URL when $showicon is true
May 23, 2026
06cfad9
Repeated the field display settings
May 25, 2026
04c5da8
Simplify secretexpiryrecipients guard using isset() instead of explic…
weilai-irl Jun 4, 2026
994ca5d
Fix XSS in cleanupoidctokens via unescaped OIDC identifier fields
patmr7 Jul 20, 2026
39917d8
Fix CSRF in cleanupoidctokens token deletion by adding sesskey valida…
patmr7 Jul 20, 2026
48f38fb
Remove Resource Owner Password Credentials (rocreds) grant from auth_…
weilai-irl Jul 28, 2026
3b81eeb
Fix open redirect in authcode handleredirect by using is_valid_local_…
patmr7 Jul 31, 2026
1ac1830
auth_oidc: added hook before_login_completed to do some checks before…
valeriocarnevale Jun 19, 2026
211b6b2
auth_oidc: address review feedback for before_login_completed hook
weilai-irl Jul 31, 2026
8ca01c2
add information on notification start
christianabila Jul 6, 2026
fefccd7
Fix wording issues in secret expiry notification help string
weilai-irl Jul 31, 2026
c35090c
Fix bug in XMLDB definition and index creation in upgrade script
weilai-irl Aug 5, 2026
0e3d0a9
Fix section error for auth_oidc configuration page
weilai-irl Aug 5, 2026
c9e1066
Add configurable login state expiry and friendly error page for expir…
weilai-irl Aug 5, 2026
6aa9c84
Update precision of sid column in auth_oidc_sid table
weilai-irl Aug 5, 2026
ebaef5a
Fix OIDC account-linking failing under SameSite=Lax
weilai-irl Aug 6, 2026
9ea17bc
fix OIDC login for manually matched users with mismatching Entra user…
weilai-irl Aug 6, 2026
4ccd05d
Update icon settings in auth_oidc
weilai-irl Aug 7, 2026
0d30a0f
Fix OIDC login CSRF by verifying sesskey on callback
patmr7 Aug 6, 2026
4fcdfb4
Fix OIDC single sign-out breaking due to SameSite cookie changes in M…
weilai-irl Aug 11, 2026
ec47c7f
Warn when "Custom" binding username claim becomes unsupported
patmr7 Aug 14, 2026
e0f7182
Merge remote-tracking branch 'origin/wip-131312-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
4aef8b7
Merge remote-tracking branch 'origin/wip-131327-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
2be0256
Merge remote-tracking branch 'origin/wip-133976-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
6b7604a
Merge remote-tracking branch 'origin/wip-133978-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
a88e908
Merge remote-tracking branch 'origin/wip-134952-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
bafb0f6
Merge remote-tracking branch 'origin/wip-133979-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
5df5d61
Merge remote-tracking branch 'origin/wip-135097-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
7c02893
Merge remote-tracking branch 'origin/wip-135099-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
4c90980
Merge remote-tracking branch 'origin/wip-135548-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
bce26b6
Merge remote-tracking branch 'origin/wip-135555-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
9e1bdbd
Merge remote-tracking branch 'origin/wip-135560-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
b591608
Merge remote-tracking branch 'origin/wip-135576-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
a5008be
Merge remote-tracking branch 'origin/wip-135628-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
d32537c
Merge remote-tracking branch 'origin/wip-135651-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
2c2ca04
Merge remote-tracking branch 'origin/wip-135748-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
7d22661
Merge remote-tracking branch 'origin/wip-133981-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
8e2b4b4
Merge remote-tracking branch 'origin/wip-132848-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
316cd7b
Merge remote-tracking branch 'origin/wip-121467-m502' into MOODLE_502…
weilai-irl Aug 17, 2026
d229b90
Update precision of sid column in auth_oidc_sid table
weilai-irl Aug 5, 2026
60a3d57
Merge branch 'wip-135576-m502' into MOODLE_502_STABLE
weilai-irl Aug 17, 2026
f0c6c8f
Update icon settings in auth_oidc
weilai-irl Aug 7, 2026
d63c05a
Merge remote-tracking branch 'origin/wip-135748-m502' into MOODLE_502…
weilai-irl Aug 18, 2026
b8059ce
Hide secret expiry notification heading when its only setting is hidden
weilai-irl Aug 19, 2026
135d25f
Merge branch 'wip-136590-m502' into MOODLE_502_STABLE
weilai-irl Aug 19, 2026
e923798
Pin GitHub Actions to full-length commit SHAs
weilai-irl Aug 24, 2026
d38faa6
Merge remote-tracking branch 'origin/wip-136722-m502' into MOODLE_502…
weilai-irl Aug 24, 2026
bf4b1e4
Add missing auth_settings_validation_error lang string
mdjnelson Aug 25, 2026
4544bde
Remove duplicate lang strings in auth_oidc
weilai-irl Aug 25, 2026
2ff0f6f
Merge remote-tracking branch 'origin/wip-136768-m502' into MOODLE_502…
weilai-irl Aug 25, 2026
addfadd
Fix admin consent redirecting to login screen after SameSite=Lax drop…
weilai-irl Aug 26, 2026
43abf4c
Fix warning message display for giving admin consent using Microsoft …
weilai-irl Aug 26, 2026
c340b53
Merge remote-tracking branch 'origin/wip-136829-m502' into MOODLE_502…
weilai-irl Aug 27, 2026
4c69462
Merge remote-tracking branch 'origin/wip-136840-m502' into MOODLE_502…
weilai-irl Aug 27, 2026
50b641b
Fix admin consent failing when app-only token request is blocked by C…
weilai-irl Aug 26, 2026
540b34a
Merge remote-tracking branch 'origin/wip-136840-m502' into MOODLE_502…
weilai-irl Aug 27, 2026
3eace2e
Make secret expiry notification heading hideable via hide_if()
weilai-irl Aug 31, 2026
717f0b6
Merge remote-tracking branch 'origin/wip-136590-m502' into MOODLE_502…
weilai-irl Aug 31, 2026
534b031
Validate secret expiry notification recipients and check deliverability
weilai-irl Aug 31, 2026
aa16c61
Merge remote-tracking branch 'origin/wip-135104-m502' into MOODLE_502…
weilai-irl Aug 31, 2026
5734ead
Update GitHub actions configuration files
weilai-irl Sep 1, 2026
3a7d54c
Fix CI workflow dependency handling and clean up service config
weilai-irl Sep 1, 2026
e0297e5
Use single Microsoft 365 logo for auth_oidc login icon
weilai-irl Sep 2, 2026
75a53e5
Merge remote-tracking branch 'origin/wip-135748-m502' into MOODLE_502…
weilai-irl Sep 2, 2026
79f2ad7
Update plugin versions for 5.2.1 release
weilai-irl Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
groups:
github-actions:
patterns: [ "*" ]
schedule:
interval: "weekly"
cooldown:
default-days: 7
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- 'MOODLE_*_STABLE'
pull_request:

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest
Expand All @@ -27,31 +30,26 @@ jobs:
mariadb:
image: mariadb:10.11
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
MYSQL_INNODB_FILE_PER_TABLE: "1"
MYSQL_INNODB_FILE_FORMAT: "Barracuda"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
moodle-branch: ['MOODLE_502_STABLE']
php: [8.3, 8.4]
database: [pgsql, mariadb]
moodle-branch: [ 'MOODLE_502_STABLE' ]
php: [ 8.3, 8.4 ]
database: [ pgsql, mariadb ]

steps:
- name: Check out repository code
uses: actions/checkout@v4
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php }}
ini-values: max_input_vars=5000
Expand Down
2 changes: 1 addition & 1 deletion classes/adminsetting/auth_oidc_admin_setting_loginflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class auth_oidc_admin_setting_loginflow extends \admin_setting {
/** @var array Array of valid login flow types. */
protected $flowtypes = ['authcode', 'rocreds'];
protected $flowtypes = ['authcode'];

/**
* Return the setting
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Admin setting class for the secret expiry notification recipients setting.
*
* @package auth_oidc
* @author Lai Wei <lai.wei@enovation.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright (C) 2026 onwards Microsoft, Inc. (http://microsoft.com/)
*/

namespace auth_oidc\adminsetting;

defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/auth/oidc/lib.php');

/**
* Admin setting for the comma-separated list of secret expiry notification recipients.
*
* Extends the standard text setting with validation that rejects the value when any entry is
* not a valid email address, so the local_o365 notifysecretexpiry task is not left silently
* dropping recipients at run time.
*/
class auth_oidc_admin_setting_secretexpiryrecipients extends \admin_setting_configtext {
/**
* Validate the submitted list of recipient email addresses.
*
* @param string $data The submitted value.
* @return string|true True when valid; a translatable error string otherwise.
*/
public function validate($data) {
$result = parent::validate($data);
if ($result !== true) {
return $result;
}

$invalidemails = auth_oidc_validate_secret_expiry_recipients((string) $data);
if ($invalidemails) {
return get_string('error_secretexpiryrecipients_invalid', 'auth_oidc', implode(', ', $invalidemails));
}

return true;
}
}
60 changes: 60 additions & 0 deletions classes/adminsetting/auth_oidc_admin_setting_section_heading.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Definition of a section heading admin setting that can be hidden with hide_if().
*
* @package auth_oidc
* @author Lai Wei <lai.wei@enovation.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright (C) 2021 onwards Microsoft, Inc. (http://microsoft.com/)
*/

namespace auth_oidc\adminsetting;

use admin_setting_heading;
use html_writer;

/**
* A section heading that participates in admin settings hide_if() dependencies.
*
* The core {@see admin_setting_heading} renders only a bare <h3>, with no named
* form control and no .form-item wrapper, so the admin settings show/hide
* JavaScript (lib/amd/src/showhidesettings.js) cannot target it and any
* hide_if() condition applied to it is silently ignored. This subclass wraps the
* heading in a .form-item container and adds a hidden input carrying the
* setting's form field name, so the heading is shown and hidden together with
* the settings it introduces.
*/
class auth_oidc_admin_setting_section_heading extends admin_setting_heading {
/**
* Output the heading wrapped so that hide_if() dependencies can act on it.
*
* @param mixed $data
* @param string $query
* @return string
*/
public function output_html($data, $query = '') {
$heading = parent::output_html($data, $query);
$hiddeninput = html_writer::empty_tag('input', [
'type' => 'hidden',
'name' => 's_' . $this->plugin . '_' . $this->name,
'value' => 1,
]);

return html_writer::div($hiddeninput . $heading, 'form-item', ['id' => 'admin-' . $this->name]);
}
}
54 changes: 54 additions & 0 deletions classes/adminsetting/auth_oidc_admin_setting_stateexpiry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <https://www.gnu.org/licenses/>.

/**
* Admin setting class for the OIDC login state expiry setting.
*
* @package auth_oidc
* @author Lai Wei <lai.wei@enovation.ie>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright (C) 2026 onwards Microsoft, Inc. (http://microsoft.com/)
*/

namespace auth_oidc\adminsetting;

/**
* Admin setting for the OIDC login state expiry, in minutes.
*
* Extends the standard text setting with validation that rejects values below one minute. A
* value of zero (or less) would cause the state cleanup task to delete login state records
* almost immediately, breaking any login that is currently in progress.
*/
class auth_oidc_admin_setting_stateexpiry extends \admin_setting_configtext {
/**
* Validate the submitted expiry value.
*
* @param string $data The submitted value.
* @return string|true True when valid; a translatable error string otherwise.
*/
public function validate($data) {
$result = parent::validate($data);
if ($result !== true) {
return $result;
}

if ((int) $data < 1) {
return get_string('error_stateexpiry_min', 'auth_oidc');
}

return true;
}
}
1 change: 1 addition & 0 deletions classes/adminsetting/iconselect.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ label.iconselect img {
width: 25px;
height: 25px;
padding: 10px;
margin-right: 0;
}
input.iconselect {
display: none;
Expand Down
9 changes: 9 additions & 0 deletions classes/form/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ public function validation($data, $files) {
}
}

// Validate secret expiry notification recipients (only relevant with secret auth).
if (isset($data['secretexpiryrecipients']) && $data['clientauthmethod'] == AUTH_OIDC_AUTH_METHOD_SECRET) {
$invalidemails = auth_oidc_validate_secret_expiry_recipients((string) $data['secretexpiryrecipients']);
if ($invalidemails) {
$errors['secretexpiryrecipients'] =
get_string('error_secretexpiryrecipients_invalid', 'auth_oidc', implode(', ', $invalidemails));
}
}

return $errors;
}

Expand Down
50 changes: 50 additions & 0 deletions classes/hook/before_login_completed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace auth_oidc\hook;

use auth_oidc\jwt;

/**
* Allow plugins to perform additional checks before a user login is completed.
*
* This hook is dispatched by auth_oidc after authenticate_user_login() has
* succeeded, but before complete_user_login() is called. The hook manager
* does not catch exceptions raised by callbacks, so a callback can reject
* the login by throwing an exception (e.g. \moodle_exception) - doing so
* will propagate out of the hook dispatch and prevent complete_user_login()
* from being called. There is no other signal (e.g. a flag on this hook) to
* reject the login; a plain return from a callback allows the login to
* proceed.
*
* @package auth_oidc
* @copyright 2026 Ariadne
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
#[\core\attribute\label('Allow plugins to perform additional checks before a user login is completed.')]
#[\core\attribute\tags('user', 'login')]
class before_login_completed {
/**
* Constructor for the hook.
*
* @param jwt $idtoken The id_token of the user attempting to log in.
*/
public function __construct(
/** @var jwt The id_token of the user attempting to log in */
public readonly jwt $idtoken
) {
}
}
Loading