MDL-75650 core: add oauth2 auth server config reader
commit40af893af545ad33c176ff25445360ef66bbfa86
authorJake Dallimore <jake@moodle.com>
Fri, 10 Feb 2023 09:36:31 +0000 (10 17:36 +0800)
committerJake Dallimore <jake@moodle.com>
Wed, 8 Mar 2023 00:48:20 +0000 (8 08:48 +0800)
tree8b65db3868ea38973a24fe8f2c725a7af87acfb8
parent556208417deb47ccea80d00849aae6fb4d47f228
MDL-75650 core: add oauth2 auth server config reader

Simple JSON reader which takes an issuer and reads its metadata. The
class is aware of request-centric rules, such as:
- The position of the well known suffix in the URL (per RFC8414)
- The requirement to have HTTPS auth server issuer URL
- The validity of query strings, paths and fragments in the auth server
issuer URL
,but makes no attempt to validate the config JSON returned.
lib/classes/oauth2/discovery/auth_server_config_reader.php [new file with mode: 0644]
lib/tests/oauth2/discovery/auth_server_config_reader_test.php [new file with mode: 0644]