ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
IMSGlobal\LTI\ToolProvider\OAuthDataStore Class Reference

Class to represent an OAuth datastore. More...

+ Inheritance diagram for IMSGlobal\LTI\ToolProvider\OAuthDataStore:
+ Collaboration diagram for IMSGlobal\LTI\ToolProvider\OAuthDataStore:

Public Member Functions

 __construct ($toolProvider)
 Class constructor. More...
 
 lookup_consumer ($consumerKey)
 Create an OAuthConsumer object for the tool consumer. More...
 
 lookup_token ($consumer, $tokenType, $token)
 Create an OAuthToken object for the tool consumer. More...
 
 lookup_nonce ($consumer, $token, $value, $timestamp)
 Lookup nonce value for the tool consumer. More...
 
 new_request_token ($consumer, $callback=null)
 Get new request token. More...
 
 new_access_token ($token, $consumer, $verifier=null)
 Get new access token. More...
 
 lookup_consumer ($consumer_key)
 
 lookup_token ($consumer, $token_type, $token)
 
 lookup_nonce ($consumer, $token, $nonce, $timestamp)
 
 new_request_token ($consumer, $callback=null)
 
 new_access_token ($token, $consumer, $verifier=null)
 

Private Attributes

 $toolProvider = null
 Tool Provider object. More...
 

Detailed Description

Class to represent an OAuth datastore.

Author
Stephen P Vickers svick.nosp@m.ers@.nosp@m.imsgl.nosp@m.obal.nosp@m..org
Date
2016
Version
3.0.2 @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0

Definition at line 16 of file OAuthDataStore.php.

Constructor & Destructor Documentation

◆ __construct()

IMSGlobal\LTI\ToolProvider\OAuthDataStore::__construct (   $toolProvider)

Class constructor.

Parameters
ToolProvider$toolProviderTool_Provider object

Definition at line 31 of file OAuthDataStore.php.

32 {
33
34 $this->toolProvider = $toolProvider;
35
36 }

References IMSGlobal\LTI\ToolProvider\OAuthDataStore\$toolProvider.

Member Function Documentation

◆ lookup_consumer()

IMSGlobal\LTI\ToolProvider\OAuthDataStore::lookup_consumer (   $consumerKey)

Create an OAuthConsumer object for the tool consumer.

Parameters
string$consumerKeyConsumer key value
Returns
OAuthConsumer OAuthConsumer object

Reimplemented from IMSGlobal\LTI\OAuth\OAuthDataStore.

Definition at line 45 of file OAuthDataStore.php.

46 {
47
48 return new OAuth\OAuthConsumer($this->toolProvider->consumer->getKey(),
49 $this->toolProvider->consumer->secret);
50
51 }

◆ lookup_nonce()

IMSGlobal\LTI\ToolProvider\OAuthDataStore::lookup_nonce (   $consumer,
  $token,
  $value,
  $timestamp 
)

Lookup nonce value for the tool consumer.

Parameters
OAuthConsumer$consumerOAuthConsumer object
string$tokenToken value
string$valueNonce value
string$timestampDate/time of request
Returns
boolean True if the nonce value already exists

Reimplemented from IMSGlobal\LTI\OAuth\OAuthDataStore.

Definition at line 79 of file OAuthDataStore.php.

80 {
81
82 $nonce = new ConsumerNonce($this->toolProvider->consumer, $value);
83 $ok = !$nonce->load();
84 if ($ok) {
85 $ok = $nonce->save();
86 }
87 if (!$ok) {
88 $this->toolProvider->reason = 'Invalid nonce.';
89 }
90
91 return !$ok;
92
93 }

References $ok.

◆ lookup_token()

IMSGlobal\LTI\ToolProvider\OAuthDataStore::lookup_token (   $consumer,
  $tokenType,
  $token 
)

Create an OAuthToken object for the tool consumer.

Parameters
string$consumerOAuthConsumer object
string$tokenTypeToken type
string$tokenToken value
Returns
OAuthToken OAuthToken object

Reimplemented from IMSGlobal\LTI\OAuth\OAuthDataStore.

Definition at line 62 of file OAuthDataStore.php.

63 {
64
65 return new OAuth\OAuthToken($consumer, '');
66
67 }
$consumer
Definition: demo.php:30

References $consumer.

◆ new_access_token()

IMSGlobal\LTI\ToolProvider\OAuthDataStore::new_access_token (   $token,
  $consumer,
  $verifier = null 
)

Get new access token.

Parameters
string$tokenToken value
OAuthConsumer$consumerOAuthConsumer object
string$verifierVerification code
Returns
string Null value

Reimplemented from IMSGlobal\LTI\OAuth\OAuthDataStore.

Definition at line 119 of file OAuthDataStore.php.

120 {
121
122 return null;
123
124 }

◆ new_request_token()

IMSGlobal\LTI\ToolProvider\OAuthDataStore::new_request_token (   $consumer,
  $callback = null 
)

Get new request token.

Parameters
OAuthConsumer$consumerOAuthConsumer object
string$callbackCallback URL
Returns
string Null value

Reimplemented from IMSGlobal\LTI\OAuth\OAuthDataStore.

Definition at line 103 of file OAuthDataStore.php.

104 {
105
106 return null;
107
108 }

Field Documentation

◆ $toolProvider

ToolProvider OAuthDataStore::$toolProvider = null
private

Tool Provider object.

Definition at line 24 of file OAuthDataStore.php.

Referenced by IMSGlobal\LTI\ToolProvider\OAuthDataStore\__construct().


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