Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
mod_lti\local\ltiopenid\registration_helper Class Reference

This class exposes functions for LTI Dynamic Registration. More...

Public Member Functions

 config_to_registration (object $config, int $typeid, object $type=null)
 Transforms a moodle LTI 1.3 Config to an OAuth/LTI Client Registration.
 
 get_tool_proxy (int $proxyid)
 Returns a tool proxy.
 
 lti_get_service_scopes ()
 Initializes an array with the scopes for services supported by the LTI module.
 
 new_clientid ()
 Generates a new client id string.
 
 registration_to_config (array $registrationpayload, string $clientid)
 Transforms an LTI 1.3 Registration to a Moodle LTI Config.
 
 sign (string $key, string $salt, string $secret)
 Base64 encoded signature for LTI 1.1 migration.
 
 validate_registration_token (string $registrationtokenjwt)
 Validates the registration token is properly signed and not used yet.
 

Static Public Member Functions

static get ()
 Get an instance of this helper.
 

Public Attributes

const REG_TOKEN_OP_NEW_REG = 'reg'
 Indicates the token is to create a new registration.
 
const REG_TOKEN_OP_UPDATE_REG = 'reg-update'
 Indicates the token is to update an existing registration.
 
const SCOPE_LINEITEM = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem'
 lineitem full access scope
 
const SCOPE_LINEITEM_RO = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly'
 lineitem read-only scope
 
const SCOPE_NRPS = 'https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly'
 Names and Roles (membership) scope.
 
const SCOPE_RESULT = 'https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly'
 result scope
 
const SCOPE_SCORE = 'https://purl.imsglobal.org/spec/lti-ags/scope/score'
 score scope
 
const SCOPE_TOOL_SETTING = 'https://purl.imsglobal.org/spec/lti-ts/scope/toolsetting'
 Tool Settings scope.
 

Detailed Description

This class exposes functions for LTI Dynamic Registration.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ config_to_registration()

mod_lti\local\ltiopenid\registration_helper::config_to_registration ( object $config,
int $typeid,
object $type = null )

Transforms a moodle LTI 1.3 Config to an OAuth/LTI Client Registration.

Parameters
object$configMoodle LTI Config.
int$typeidwhich is the LTI deployment id.
object$typetool instance in case the tool already exists.
Return values
arraythe Client Registration as an associative array.

◆ get()

static mod_lti\local\ltiopenid\registration_helper::get ( )
static

Get an instance of this helper.

Return values
object

◆ get_tool_proxy()

mod_lti\local\ltiopenid\registration_helper::get_tool_proxy ( int $proxyid)

Returns a tool proxy.

Parameters
int$proxyid
Return values
mixedTool Proxy details

◆ lti_get_service_scopes()

mod_lti\local\ltiopenid\registration_helper::lti_get_service_scopes ( )

Initializes an array with the scopes for services supported by the LTI module.

Return values
arrayList of scopes

◆ new_clientid()

mod_lti\local\ltiopenid\registration_helper::new_clientid ( )

Generates a new client id string.

Return values
stringgenerated client id

◆ registration_to_config()

mod_lti\local\ltiopenid\registration_helper::registration_to_config ( array $registrationpayload,
string $clientid )

Transforms an LTI 1.3 Registration to a Moodle LTI Config.

Parameters
array$registrationpayloadthe registration data received from the tool.
string$clientidthe clientid to be issued for that tool.
Return values
objectthe Moodle LTI config.

◆ sign()

mod_lti\local\ltiopenid\registration_helper::sign ( string $key,
string $salt,
string $secret )

Base64 encoded signature for LTI 1.1 migration.

Parameters
string$keyLTI 1.1 key
string$saltSalt value
string$secretLTI 1.1 secret
Return values
stringbase64encoded hash

◆ validate_registration_token()

mod_lti\local\ltiopenid\registration_helper::validate_registration_token ( string $registrationtokenjwt)

Validates the registration token is properly signed and not used yet.

Return the client id to use for this registration.

Parameters
string$registrationtokenjwtregistration token
Return values
arraywith 2 keys: clientid for the registration, type but only if it's an update

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