ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
OAuthDataStore.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
17 {
18 
24  private $toolProvider = null;
25 
31  public function __construct($toolProvider)
32  {
33 
34  $this->toolProvider = $toolProvider;
35 
36  }
37 
45  function lookup_consumer($consumerKey)
46  {
47 
48  return new OAuth\OAuthConsumer($this->toolProvider->consumer->getKey(),
49  $this->toolProvider->consumer->secret);
50 
51  }
52 
62  function lookup_token($consumer, $tokenType, $token)
63  {
64 
65  return new OAuth\OAuthToken($consumer, '');
66 
67  }
68 
79  function lookup_nonce($consumer, $token, $value, $timestamp)
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  }
94 
103  function new_request_token($consumer, $callback = null)
104  {
105 
106  return null;
107 
108  }
109 
119  function new_access_token($token, $consumer, $verifier = null)
120  {
121 
122  return null;
123 
124  }
125 
126 }
new_request_token($consumer, $callback=null)
Get new request token.
Class to represent a tool consumer nonce.
Class to represent an OAuth Data Store.
new_access_token($token, $consumer, $verifier=null)
Get new access token.
lookup_nonce($consumer, $token, $value, $timestamp)
Lookup nonce value for the tool consumer.
Class to represent an OAuth Token.
Definition: OAuthToken.php:12
Class to represent an OAuth Consumer.
$consumer
Definition: demo.php:30
lookup_token($consumer, $tokenType, $token)
Create an OAuthToken object for the tool consumer.
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
__construct($toolProvider)
Class constructor.
lookup_consumer($consumerKey)
Create an OAuthConsumer object for the tool consumer.