Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function generateResponse()
 {
     $macKey = SecureKey::generate();
     $this->server->getMacStorage()->create($macKey, $this->getParam('access_token'));
     $response = ['access_token' => $this->getParam('access_token'), 'token_type' => 'mac', 'expires_in' => $this->getParam('expires_in'), 'mac_key' => $macKey, 'mac_algorithm' => 'hmac-sha-256'];
     return $response;
 }
 /**
  * Set token ID
  *
  * @param string $id Token ID
  *
  * @return self
  */
 public function setId($id = null)
 {
     if ($id != null) {
         $this->isNew = false;
         $this->id = $id;
     } else {
         $this->id = SecureKey::generate();
     }
     return $this;
 }