diff --git a/admin/tool/mobile/classes/api.php b/admin/tool/mobile/classes/api.php index 68363affd31..1545996f252 100644 --- a/admin/tool/mobile/classes/api.php +++ b/admin/tool/mobile/classes/api.php @@ -153,6 +153,14 @@ class api { $settings['compactlogourl'] = $compactlogourl->out(false); } + // Identity providers. + $authsequence = get_enabled_auth_plugins(true); + $identityproviders = \auth_plugin_base::get_identity_providers($authsequence); + $identityprovidersdata = \auth_plugin_base::prepare_identity_providers_for_output($identityproviders, $OUTPUT); + if (!empty($identityprovidersdata)) { + $settings['identityproviders'] = $identityprovidersdata; + } + return $settings; } diff --git a/admin/tool/mobile/classes/external.php b/admin/tool/mobile/classes/external.php index d56966e99a2..a9fdd1fa7c6 100644 --- a/admin/tool/mobile/classes/external.php +++ b/admin/tool/mobile/classes/external.php @@ -150,6 +150,16 @@ class external extends external_api { 'launchurl' => new external_value(PARAM_URL, 'SSO login launch URL. Empty if it won\'t be used.', VALUE_OPTIONAL), 'mobilecssurl' => new external_value(PARAM_URL, 'Mobile custom CSS theme', VALUE_OPTIONAL), 'tool_mobile_disabledfeatures' => new external_value(PARAM_RAW, 'Disabled features in the app', VALUE_OPTIONAL), + 'identityproviders' => new external_multiple_structure( + new external_single_structure( + array( + 'name' => new external_value(PARAM_TEXT, 'The identity provider name.'), + 'iconurl' => new external_value(PARAM_URL, 'The icon URL for the provider.'), + 'url' => new external_value(PARAM_URL, 'The URL of the provider.'), + ) + ), + 'Identity providers', VALUE_OPTIONAL + ), 'warnings' => new external_warnings(), ) ); diff --git a/admin/tool/mobile/upgrade.txt b/admin/tool/mobile/upgrade.txt index ccfc819be22..9a93520e9ca 100644 --- a/admin/tool/mobile/upgrade.txt +++ b/admin/tool/mobile/upgrade.txt @@ -4,4 +4,5 @@ Information provided here is intended especially for developers. === 3.3 === * External function tool_mobile::get_public_config now returns the mobilecssurl field (Mobile custom CSS theme). + * External function tool_mobile::get_public_config now returns the identityproviders field (list of external identity providers).