ILIAS  release_8 Revision v8.23
TrivialOAuthDataStore.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
8 class TrivialOAuthDataStore extends \ILIAS\LTIOAuth\OAuthDataStore
9 {
10  private array $consumers = array();
11 
12  public function add_consumer($consumer_key, $consumer_secret): void
13  {
14  $this->consumers[$consumer_key] = $consumer_secret;
15  }
16 
17  public function lookup_consumer($consumer_key): ?ILIAS\LTIOAuth\OAuthConsumer
18  {
19  if (strpos($consumer_key, "http://") === 0) {
20  return new \ILIAS\LTIOAuth\OAuthConsumer($consumer_key, "secret", null);
21  }
22  if ($this->consumers[$consumer_key]) {
23  return new \ILIAS\LTIOAuth\OAuthConsumer($consumer_key, $this->consumers[$consumer_key], null);
24  }
25  return null;
26  }
27 
28  public function lookup_token($consumer, $token_type, $token): \OAuthToken
29  {
30  return new OAuthToken($consumer, "");
31  }
32 
33  // Return NULL if the nonce has not been used
34  // Return $nonce if the nonce was previously used
35  public function lookup_nonce($consumer, $token, $nonce, $timestamp)
36  {
37  // Should add some clever logic to keep nonces from
38  // being reused - for no we are really trusting
39  // that the timestamp will save us
40  return null;
41  }
42 
43  public function new_request_token($consumer, $callback = null)
44  {
45  return null;
46  }
47 
48  public function new_access_token($token, $consumer, $verifier = null)
49  {
50  return null;
51  }
52 }
add_consumer($consumer_key, $consumer_secret)
Class ChatMainBarProvider .
lookup_nonce($consumer, $token, $nonce, $timestamp)
new_access_token($token, $consumer, $verifier=null)
$token
Definition: xapitoken.php:70
A Trivial memory-based store - no support for tokens.
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
new_request_token($consumer, $callback=null)
lookup_token($consumer, $token_type, $token)