Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Static list of api methods for system oauth2 configuration. More...
Static Public Member Functions | |
static | connect_system_account ($issuer, $returnurl) |
Perform the OAuth dance and get a refresh token. More... | |
static | create_endpoint ($data) |
Take the data from the mform and create the endpoint. More... | |
static | create_endpoints_for_standard_issuer ($type, $issuer) |
Create endpoints for standard issuers, based on the issuer created from submitted data. More... | |
static | create_issuer ($data) |
Take the data from the mform and create the issuer. More... | |
static | create_standard_issuer ($type, $baseurl=false) |
Create one of the standard issuers. More... | |
static | create_user_field_mapping ($data) |
Take the data from the mform and create the user field mapping. More... | |
static | delete_endpoint ($id) |
Delete an endpoint. More... | |
static | delete_issuer ($id) |
Delete an identity issuer. More... | |
static | delete_user_field_mapping ($id) |
Delete a user_field_mapping. More... | |
static | disable_issuer ($id) |
Disable an identity issuer. More... | |
static | enable_issuer ($id) |
Enable an identity issuer. More... | |
static | get_all_issuers () |
List all the issuers, ordered by the sortorder field. More... | |
static | get_endpoint ($id) |
Get a single endpoint by id. More... | |
static | get_endpoints (issuer $issuer) |
Get the list of defined endpoints for this OAuth issuer. More... | |
static | get_issuer ($id) |
Get a single issuer by id. More... | |
static | get_system_account (issuer $issuer) |
Get the system account for an installed OAuth service. More... | |
static | get_system_oauth_client (issuer $issuer) |
Get an authenticated oauth2 client using the system account. More... | |
static | get_system_scopes_for_issuer ($issuer) |
Get the full list of system scopes required by an oauth issuer. More... | |
static | get_user_field_mapping ($id) |
Get a single user field mapping by id. More... | |
static | get_user_field_mappings (issuer $issuer) |
Get the list of defined mapping from OAuth user fields to moodle user fields. More... | |
static | get_user_oauth_client (issuer $issuer, moodle_url $currenturl, $additionalscopes='') |
Get an authenticated oauth2 client using the current user account. More... | |
static | init_standard_issuer ($type) |
Initializes a record for one of the standard issuers to be displayed in the settings. More... | |
static | move_down_issuer ($id) |
Reorder this identity issuer. More... | |
static | move_up_issuer ($id) |
Reorder this identity issuer. More... | |
static | update_endpoint ($data) |
Take the data from the mform and update the endpoint. More... | |
static | update_issuer ($data) |
Take the data from the mform and update the issuer. More... | |
static | update_user_field_mapping ($data) |
Take the data from the mform and update the user field mapping. More... | |
Static Protected Member Functions | |
static | discover_endpoints ($issuer) |
If the discovery endpoint exists for this issuer, try and determine the list of valid endpoints. More... | |
static | guess_image ($issuer) |
Guess an image from the discovery URL. More... | |
Static list of api methods for system oauth2 configuration.
|
static |
Perform the OAuth dance and get a refresh token.
Requires moodle/site:config capability at the system context.
core\oauth2\issuer | $issuer | |
moodle_url | $returnurl | The url to the current page (we will be redirected back here after authentication). |
boolean |
|
static |
Take the data from the mform and create the endpoint.
stdClass | $data |
core |
|
static |
Create endpoints for standard issuers, based on the issuer created from submitted data.
string | $type | One of google, facebook, microsoft, nextcloud |
issuer | $issuer | issuer the endpoints should be created for. |
core |
|
static |
Take the data from the mform and create the issuer.
stdClass | $data |
core |
|
static |
Create one of the standard issuers.
string | $type | One of google, facebook, microsoft, or nextcloud |
string | false | $baseurl | Baseurl (only required for nextcloud) |
core |
|
static |
Take the data from the mform and create the user field mapping.
stdClass | $data |
core |
|
static |
Delete an endpoint.
Requires moodle/site:config capability at the system context.
int | $id | The id of the endpoint to delete. |
boolean |
|
static |
Delete an identity issuer.
Requires moodle/site:config capability at the system context.
int | $id | The id of the identity issuer to delete. |
boolean |
|
static |
Delete a user_field_mapping.
Requires moodle/site:config capability at the system context.
int | $id | The id of the user_field_mapping to delete. |
boolean |
|
static |
Disable an identity issuer.
Requires moodle/site:config capability at the system context.
int | $id | The id of the identity issuer to disable. |
boolean |
|
staticprotected |
If the discovery endpoint exists for this issuer, try and determine the list of valid endpoints.
issuer | $issuer |
int | The number of discovered services. |
|
static |
Enable an identity issuer.
Requires moodle/site:config capability at the system context.
int | $id | The id of the identity issuer to enable. |
boolean |
|
static |
List all the issuers, ordered by the sortorder field.
core |
|
static |
Get a single endpoint by id.
int | $id |
core |
|
static |
Get the list of defined endpoints for this OAuth issuer.
core\oauth2\issuer | $issuer | The desired OAuth issuer |
core |
|
static |
Get a single issuer by id.
int | $id |
core |
|
static |
Get the system account for an installed OAuth service.
Never ever ever expose this to a webservice because it contains the refresh token which grants API access.
core\oauth2\issuer | $issuer |
system_account|false |
|
static |
Get an authenticated oauth2 client using the system account.
This call uses the refresh token to get an access token.
core\oauth2\issuer | $issuer |
core |
|
static |
Get the full list of system scopes required by an oauth issuer.
This includes the list required for login as well as any scopes injected by the oauth2_system_scopes callback in plugins.
core\oauth2\issuer | $issuer |
string |
|
static |
Get a single user field mapping by id.
int | $id |
core |
|
static |
Get the list of defined mapping from OAuth user fields to moodle user fields.
core\oauth2\issuer | $issuer | The desired OAuth issuer |
core |
|
static |
Get an authenticated oauth2 client using the current user account.
This call does the redirect dance back to the current page after authentication.
core\oauth2\issuer | $issuer | The desired OAuth issuer |
moodle_url | $currenturl | The url to the current page. |
string | $additionalscopes | The additional scopes required for authorization. |
core |
|
staticprotected |
Guess an image from the discovery URL.
core\oauth2\issuer | $issuer | The desired OAuth issuer |
|
static |
Initializes a record for one of the standard issuers to be displayed in the settings.
The issuer is not yet created in the database.
string | $type | One of google, facebook, microsoft, nextcloud |
core |
|
static |
Reorder this identity issuer.
Requires moodle/site:config capability at the system context.
int | $id | The id of the identity issuer to move. |
boolean |
|
static |
Reorder this identity issuer.
Requires moodle/site:config capability at the system context.
int | $id | The id of the identity issuer to move. |
boolean |
|
static |
Take the data from the mform and update the endpoint.
stdClass | $data |
core |
|
static |
Take the data from the mform and update the issuer.
stdClass | $data |
core |
|
static |
Take the data from the mform and update the user field mapping.
stdClass | $data |
core |