diff --git a/admin/tool/oauth2/classes/form/issuer.php b/admin/tool/oauth2/classes/form/issuer.php index f9b9f8a9d91..902210bc8ae 100644 --- a/admin/tool/oauth2/classes/form/issuer.php +++ b/admin/tool/oauth2/classes/form/issuer.php @@ -244,7 +244,6 @@ class issuer extends persistent { * @return array of additional errors, or overridden errors. */ protected function extra_validation($data, $files, array &$errors) { - $errors = []; if ($data->showonloginpage != \core\oauth2\issuer::SERVICEONLY) { if (!strlen(trim($data->loginscopes))) { $errors['loginscopes'] = get_string('required'); diff --git a/admin/tool/oauth2/tests/behat/basic_settings.feature b/admin/tool/oauth2/tests/behat/basic_settings.feature index 6a190be0c3f..8b4ea4f23c0 100644 --- a/admin/tool/oauth2/tests/behat/basic_settings.feature +++ b/admin/tool/oauth2/tests/behat/basic_settings.feature @@ -218,9 +218,13 @@ Feature: Basic OAuth2 functionality | Name | Invalid custom service | | Client ID | thisistheclientid | | Client secret | supersecret | - | Service base URL | https://dc.imsglobal.org/ | + | Service base URL | http://dc.imsglobal.org/ | When I press "Save changes" - Then I should see "Could not discover end points for identity issuer: Invalid custom service" + Then I should see "For security reasons only https connections are allowed, sorry" + And I set the following fields to these values: + | Service base URL | https://dc.imsglobal.org/ | + And I press "Save changes" + And I should see "Could not discover end points for identity issuer: Invalid custom service" And I should see "URL: https://dc.imsglobal.org/.well-known/openid-configuration" And "Allow services" "icon" should exist in the "Invalid custom service" "table_row" And "Do not allow login" "icon" should exist in the "Invalid custom service" "table_row"