LTI Integration Library  3.1.0
PHP class library for building LTI integrations
OAuthDataStore.php
Go to the documentation of this file.
1 <?php
2 
3 namespace ceLTIc\LTI;
4 
8 
18 {
19 
25  private $toolProvider = null;
26 
32  public function __construct($toolProvider)
33  {
34  $this->toolProvider = $toolProvider;
35  }
36 
44  function lookup_consumer($consumerKey)
45  {
46  return new OAuthConsumer($this->toolProvider->consumer->getKey(), $this->toolProvider->consumer->secret);
47  }
48 
58  function lookup_token($consumer, $tokenType, $token)
59  {
60  return new OAuthToken($consumer, '');
61  }
62 
73  function lookup_nonce($consumer, $token, $value, $timestamp)
74  {
75  $nonce = new ConsumerNonce($this->toolProvider->consumer, $value);
76  $ok = !$nonce->load();
77  if ($ok) {
78  $ok = $nonce->save();
79  }
80  if (!$ok) {
81  $this->toolProvider->reason = 'Invalid nonce.';
82  }
83 
84  return !$ok;
85  }
86 
95  function new_request_token($consumer, $callback = null)
96  {
97  return null;
98  }
99 
109  function new_access_token($token, $consumer, $verifier = null)
110  {
111  return null;
112  }
113 
114 }
new_access_token($token, $consumer, $verifier=null)
Get new access token.
Class to represent an OAuth Consumer.
lookup_consumer($consumerKey)
Create an OAuthConsumer object for the tool consumer.
Class to represent a tool consumer nonce.
__construct($toolProvider)
Class constructor.
new_request_token($consumer, $callback=null)
Get new request token.
lookup_token($consumer, $tokenType, $token)
Create an OAuthToken object for the tool consumer.
Class to represent an OAuth Data Store.
Class to represent an OAuth Token.
Definition: OAuthToken.php:12
lookup_nonce($consumer, $token, $value, $timestamp)
Lookup nonce value for the tool consumer.