Class to represent a tool consumer. More...
Public Member Functions | |
__construct ($key=null, $dataConnector=null, $autoEnable=false) | |
Class constructor. | |
![]() | |
__construct ($dataConnector=null) | |
Class constructor. | |
initialize () | |
Initialise the platform. | |
initialise () | |
Initialise the platform. | |
save () | |
Save the platform to the database. | |
delete () | |
Delete the platform from the database. | |
getId () | |
Get the platform ID. | |
getFamilyCode () | |
Get platform family code (as reported by last platform connection). | |
getDataConnector () | |
Get the data connector. | |
getAccessToken () | |
Get the authorization access token. | |
setAccessToken ($accessToken) | |
Set the authorization access token. | |
getIsAvailable () | |
Is the platform available to accept launch requests? | |
hasToolSettingsService () | |
Check if the Tool Settings service is supported. | |
getToolSettings ($simple=true) | |
Get Tool Settings. | |
setToolSettings ($settings=array()) | |
Set Tool Settings. | |
getTools () | |
Get an array of defined tools. | |
hasAccessTokenService () | |
Check if the Access Token service is supported. | |
getMessageParameters () | |
Get the message parameters. | |
handleRequest () | |
Process an incoming request. | |
![]() | |
getRecordId () | |
Get the system record ID. | |
setRecordId ($id) | |
Sets the system record ID. | |
getKey () | |
Get the consumer key. | |
setKey ($key) | |
Set the consumer key. | |
getSetting ($name, $default='') | |
Get a setting value. | |
setSetting ($name, $value=null) | |
Set a setting value. | |
getSettings () | |
Get an array of all setting values. | |
setSettings ($settings) | |
Set an array of all setting values. | |
saveSettings () | |
Save setting values. | |
hasJwt () | |
Check whether a JWT exists. | |
getJwt () | |
Get the JWT. | |
getRawParameters () | |
Get the raw POST parameters. | |
getMessageClaims ($fullyQualified=false) | |
Get the message claims. | |
signParameters ($url, $type, $version, $params) | |
Add the signature to an LTI message. | |
signMessage (&$url, $type, $version, $params, $loginHint=null, $ltiMessageHint=null) | |
Add the signature to an LTI message. | |
sendMessage ($url, $type, $messageParams, $target='', $userId=null, $hint=null) | |
Generate a web page containing an auto-submitted form of LTI message parameters. | |
signServiceRequest ($url, $method, $type, $data=null) | |
Generates the headers for an LTI service request. | |
doServiceRequest ($service, $method, $format, $data) | |
Perform a service request. | |
useOAuth1 () | |
Determine whether this consumer is using the OAuth 1 security model. | |
addSignature ($endpoint, $data, $method='POST', $type=null, $nonce='', $hash=null, $timestamp=null) | |
Add the signature to an array of message parameters or to a header string. | |
checkMessage () | |
Verify the required properties of an LTI message. | |
verifySignature () | |
Verify the signature of a message. | |
Additional Inherited Members | |
![]() | |
static | fromConsumerKey ($key=null, $dataConnector=null, $autoEnable=false) |
Load the platform from the database by its consumer key. | |
static | fromPlatformId ($platformId, $clientId, $deploymentId, $dataConnector=null, $autoEnable=false) |
Load the platform from the database by its platform, client and deployment IDs. | |
static | fromRecordId ($id, $dataConnector) |
Load the platform from the database by its record ID. | |
static | getStorageJS () |
Get the JavaScript for handling storage postMessages from a tool. | |
![]() | |
static | parseRoles ($roles, $ltiVersion=Util::LTI_VERSION1, $addPrincipalRole=false) |
Parse a set of roles to comply with a specified version of LTI. | |
![]() | |
static | registerApiHook ($hookName, $familyCode, $className) |
Register the availability of an API hook. | |
![]() | |
$name = null | |
Local name of platform. | |
$platformId = null | |
Platform ID. | |
$clientId = null | |
Client ID. | |
$deploymentId = null | |
Deployment ID. | |
$authorizationServerId = null | |
Authorization server ID. | |
$authenticationUrl = null | |
Login authentication URL. | |
$accessTokenUrl = null | |
Access Token service URL. | |
$consumerName = null | |
Name of platform (as reported by last platform connection). | |
$consumerVersion = null | |
Platform version (as reported by last platform connection). | |
$profile = null | |
The platform profile data. | |
$toolProxy = null | |
The tool proxy. | |
$consumerGuid = null | |
Platform GUID (as reported by first platform connection). | |
$cssPath = null | |
Optional CSS path (as reported by last platform connection). | |
$protected = false | |
Whether the platform instance is protected by matching the consumer_guid value in incoming requests. | |
$idScope = Tool::ID_SCOPE_ID_ONLY | |
Default scope to use when generating an Id value for a user. | |
$defaultEmail = '' | |
Default email address (or email domain) to use when no email address is provided for a user. | |
$lastServiceRequest = null | |
HttpMessage object for last service request. | |
![]() | |
$ok = true | |
True if the last request was successful. | |
$ltiVersion = null | |
LTI version. | |
$name = null | |
Local name of platform/tool. | |
$secret = null | |
Shared secret. | |
$signatureMethod = 'HMAC-SHA1' | |
Method used for signing messages. | |
$encryptionMethod = '' | |
Algorithm used for encrypting messages. | |
$dataConnector = null | |
Data connector object. | |
$rsaKey = null | |
RSA key in PEM or JSON format. | |
$requiredScopes = array() | |
Scopes to request when obtaining an access token. | |
$kid = null | |
Key ID. | |
$jku = null | |
Endpoint for public key. | |
$reason = null | |
Error message for last request processed. | |
$details = array() | |
Details for error message relating to last request processed. | |
$warnings = array() | |
Warnings relating to last request processed. | |
$debugMode = false | |
Whether debug level messages are to be reported. | |
$enabled = false | |
Whether the system instance is enabled to accept connection requests. | |
$enableFrom = null | |
Timestamp from which the the system instance is enabled to accept connection requests. | |
$enableUntil = null | |
Timestamp until which the system instance is enabled to accept connection requests. | |
$lastAccess = null | |
Timestamp for date of last connection to this system. | |
$created = null | |
Timestamp for when the object was created. | |
$updated = null | |
Timestamp for when the object was last updated. | |
![]() | |
static | $MESSAGE_TYPES |
List of supported incoming message types. | |
static | $browserStorageFrame = null |
Name of browser storage frame. | |
![]() | |
static | $USER_ID_HOOK = "UserId" |
User Id hook name. | |
static | $CONTEXT_ID_HOOK = "ContextId" |
Context Id hook name. | |
static | $GROUPS_SERVICE_HOOK = "Groups" |
Course Groups service hook name. | |
static | $MEMBERSHIPS_SERVICE_HOOK = "Memberships" |
Memberships service hook name. | |
static | $OUTCOMES_SERVICE_HOOK = "Outcomes" |
Outcomes service hook name. | |
static | $TOOL_SETTINGS_SERVICE_HOOK = "ToolSettings" |
Tool Settings service hook name. | |
static | $ACCESS_TOKEN_SERVICE_HOOK = "AccessToken" |
Access Token service hook name. | |
![]() | |
onInitiateLogin (&$url, &$loginHint, &$ltiMessageHint, $params) | |
Save the hint and message parameters when sending an initiate login request. | |
onAuthenticate () | |
Check the hint and recover the message parameters for an authentication request. | |
onContentItem () | |
Process a valid content-item message. | |
onLtiStartAssessment () | |
Process a valid start assessment message. | |
onError () | |
Process a response to an invalid message. | |
![]() | |
$jwt = null | |
JWT ClientInterface object. | |
$rawParameters = null | |
Raw message parameters. | |
$messageParameters = null | |
LTI message parameters. | |
Class to represent a tool consumer.
Definition at line 17 of file ToolConsumer.php.
__construct | ( | $key = null , |
|
$dataConnector = null , |
|||
$autoEnable = false |
|||
) |
Class constructor.
string | $key | Consumer key/client ID |
DataConnector | $dataConnector | A data connector object |
bool | $autoEnable | true if the tool consumer is to be enabled automatically (optional, default is false) |
Definition at line 27 of file ToolConsumer.php.
References System\$dataConnector, Platform\fromConsumerKey(), Util\logDebug(), System\setKey(), and System\setRecordId().