LTI Integration Library 5.1.4
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
AccessToken Class Reference

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.
 

Detailed Description

Class to represent an HTTP message.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
Version
3.0.0
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

__construct ( Platform $platform,
?array $scopes = [],
?string $token = null,
?int $expires = null )

Class constructor.

Parameters
Platform$platformPlatform
array | null$scopesScopes for which the access token is valid
string | null$tokenAccess token string
int | null$expiresTime in seconds after which the token string will expire

Member Function Documentation

◆ get()

AccessToken get ( string $scope = '',
bool $scopeOnly = false )

Obtain a valid access token for a scope.

Parameters
string$scopeAccess scope
bool$scopeOnlyIf true, a token is requested just for the specified scope
Returns
AccessToken New access token

Referenced by DataConnector\savePlatformNonce().

◆ getPlatform()

Platform getPlatform ( )

Get platform.

Returns
Platform Platform object for this resource link.

Referenced by DataConnector\savePlatformNonce(), DataConnector_mysqli\savePlatformNonce(), and DataConnector_sql\savePlatformNonce().

◆ hasScope()

bool hasScope ( string $scope = '')

Check if a valid access token exists for a specific scope (or any scope if none specified).

Parameters
string$scopeAccess scope
Returns
bool True if there is an unexpired access token for specified scope

References Tool\$defaultTool, and System\signServiceRequest().

◆ load()

bool load ( )

Load a nonce value from the database.

Returns
bool True if the nonce value was successfully loaded

◆ save()

bool save ( )

Save a nonce value in the database.

Returns
bool True if the nonce value was successfully saved