Inheritance: extends Thruway\Peer\Client
 /**
  * Constructor
  * 
  * @param array $authRealms
  * @param \React\Http\Server $http
  * @param string $clientId
  * @param string $clientSecret
  */
 public function __construct($authRealms, $http, $clientId, $clientSecret)
 {
     $this->clientId = $clientId;
     $this->clientSecret = $clientSecret;
     parent::__construct($authRealms);
     //Register Http request event
     $http->on('request', [$this, "onHttpRequest"]);
 }
 /**
  * @inheritDoc
  */
 public function onSessionStart($session, $transport)
 {
     parent::onSessionStart($session, $transport);
     $connection = new React\MySQL\Connection($this->getLoop(), array('dbname' => 'thruway_auth_example', 'user' => 'root', 'passwd' => 'root', 'port' => 8889));
     //connecting to mysql server, not required.
     $connection->connect(function () {
     });
     $this->mysqlConnection = $connection;
 }
Beispiel #3
0
 /**
  * Constructor
  *
  * @param array $authRealms
  * @param \React\EventLoop\LoopInterface $loop
  */
 public function __construct(Container $application, array $authRealms)
 {
     $this->application = $application;
     /*
      * Set authorization the realm. Defaults to "thruway.auth"
      *
      * This realm is only used between the Authentication Provider Client and the Authentication Manager Client on the server.
      *
      */
     parent::__construct($authRealms);
 }
Beispiel #4
0
 public function onSessionStart($session, $transport)
 {
     parent::onSessionStart($session, $transport);
     $loop = $this->getLoop();
     $loop->addPeriodicTimer(30, function () use($session, $loop) {
         $this->getLogger()->info("Sending a Ping from auth provider\n");
         $session->ping(5);
         $loop->tick();
     });
 }
 function __construct(array $authRealms, $clientId, $clientSecret)
 {
     $this->clientId = $clientId;
     $this->clientSecret = $clientSecret;
     parent::__construct($authRealms);
 }
 /**
  * Constructor
  * 
  * @param array $authRealms
  * @param string $appId
  * @param string $appSecret
  */
 public function __construct(array $authRealms, $appId, $appSecret)
 {
     $this->appId = $appId;
     $this->appSecret = $appSecret;
     parent::__construct($authRealms);
 }