Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core\oauth2\discovery\auth_server_config_reader Class Reference

Public Member Functions

 __construct (protected http_client $httpclient, protected string $wellknownsuffix='oauth-authorization-server')
 Constructor.
 
 read_configuration (\moodle_url $issuerurl)
 Read the metadata from the remote host.
 

Protected Member Functions

 get_configuration_url ()
 Get the Auth server metadata URL.
 
 validate_uri ()
 Make sure the base URI is suitable for use in discovery.
 

Protected Attributes

moodle_url moodle_url $issuerurl
 the base URL for the auth server which was last used during a read.
 
stdClass stdClass $metadata
 the config object read from the discovery document.
 

Constructor & Destructor Documentation

◆ __construct()

core\oauth2\discovery\auth_server_config_reader::__construct ( protected http_client $httpclient,
protected string $wellknownsuffix = 'oauth-authorization-server' )

Constructor.

Parameters
http_client$httpclientan http client instance.
string$wellknownsuffixthe well-known suffix, defaulting to 'oauth-authorization-server'.

Member Function Documentation

◆ get_configuration_url()

core\oauth2\discovery\auth_server_config_reader::get_configuration_url ( )
protected

Get the Auth server metadata URL.

Per , if the issuer URL contains a path component, the well known suffix is added between the host and path components.

Return values
moodle_urlthe full URL to the auth server metadata.

◆ read_configuration()

core\oauth2\discovery\auth_server_config_reader::read_configuration ( \moodle_url $issuerurl)

Read the metadata from the remote host.

Parameters
moodle_url$issuerurlthe auth server issuer URL.
Return values
stdClassthe configuration data object.
Exceptions
ClientException|GuzzleHttp\Exception\GuzzleExceptionif the http client experiences any problems.

◆ validate_uri()

core\oauth2\discovery\auth_server_config_reader::validate_uri ( )
protected

Make sure the base URI is suitable for use in discovery.

Return values
void
Exceptions
moodle_exceptionif the URI fails validation.

The documentation for this class was generated from the following file: