Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 109 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

auth_server_config_reader:: (4 methods):
  __construct()
  read_configuration()
  validate_uri()
  get_configuration_url()


Class: auth_server_config_reader  - X-Ref

Simple reader class, allowing OAuth 2 Authorization Server Metadata to be read from an auth server's well-known.

{@link https://www.rfc-editor.org/rfc/rfc8414}

__construct(protected http_client $httpclient,protected string $wellknownsuffix = 'oauth-authorization-server')   X-Ref
Constructor.

param: http_client $httpclient an http client instance.
param: string $wellknownsuffix the well-known suffix, defaulting to 'oauth-authorization-server'.

read_configuration(\moodle_url $issuerurl)   X-Ref
Read the metadata from the remote host.

param: \moodle_url $issuerurl the auth server issuer URL.
return: \stdClass the configuration data object.

validate_uri()   X-Ref
Make sure the base URI is suitable for use in discovery.

return: void

get_configuration_url()   X-Ref
Get the Auth server metadata URL.

Per {@link https://www.rfc-editor.org/rfc/rfc8414#section-3}, if the issuer URL contains a path component,
the well known suffix is added between the host and path components.

return: \moodle_url the full URL to the auth server metadata.