Class to represent an HTTP message. More...
Public Member Functions | |
__construct (Platform $platform, ?array $scopes=[], ?string $token=null, ?int $expires=null) | |
Class constructor. | |
Platform | getPlatform () |
Get platform. | |
bool | load () |
Load a nonce value from the database. | |
bool | save () |
Save a nonce value in the database. | |
bool | hasScope (string $scope='') |
Check if a valid access token exists for a specific scope (or any scope if none specified). | |
AccessToken | get (string $scope='', bool $scopeOnly=false) |
Obtain a valid access token for a scope. | |
Public Attributes | |
string | $token = null |
Access token string. | |
int | $expires = null |
Timestamp at which the token string expires. | |
array | $scopes = [] |
Scope(s) for which the access token is valid. | |
int | $created = null |
Timestamp for when the object was created. | |
int | $updated = null |
Timestamp for when the object was last updated. | |
Class to represent an HTTP message.
ceLTIc\LTI\AccessToken::__construct | ( | Platform | $platform, |
?array | $scopes = [], | ||
?string | $token = null, | ||
?int | $expires = null ) |
Class constructor.
Platform | $platform | Platform |
array | null | $scopes | Scopes for which the access token is valid |
string | null | $token | Access token string |
int | null | $expires | Time in seconds after which the token string will expire |
AccessToken ceLTIc\LTI\AccessToken::get | ( | string | $scope = '', |
bool | $scopeOnly = false ) |
Obtain a valid access token for a scope.
string | $scope | Access scope |
bool | $scopeOnly | If true, a token is requested just for the specified scope |
Referenced by ceLTIc\LTI\DataConnector\DataConnector\savePlatformNonce().
Platform ceLTIc\LTI\AccessToken::getPlatform | ( | ) |
Get platform.
Referenced by ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_sql\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector\savePlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\savePlatformNonce(), and ceLTIc\LTI\DataConnector\DataConnector_sql\savePlatformNonce().
bool ceLTIc\LTI\AccessToken::hasScope | ( | string | $scope = '' | ) |
Check if a valid access token exists for a specific scope (or any scope if none specified).
string | $scope | Access scope |
References ceLTIc\LTI\Tool\$defaultTool.
bool ceLTIc\LTI\AccessToken::load | ( | ) |
Load a nonce value from the database.
References ceLTIc\LTI\Tool\$defaultTool.
bool ceLTIc\LTI\AccessToken::save | ( | ) |
Save a nonce value in the database.
int ceLTIc\LTI\AccessToken::$created = null |
Timestamp for when the object was created.
int ceLTIc\LTI\AccessToken::$expires = null |
Timestamp at which the token string expires.
array ceLTIc\LTI\AccessToken::$scopes = [] |
Scope(s) for which the access token is valid.
string ceLTIc\LTI\AccessToken::$token = null |
Access token string.
int ceLTIc\LTI\AccessToken::$updated = null |
Timestamp for when the object was last updated.