Пример #1
0
 /**
  * Validates a passed-in token.
  * 
  * @param string $token A urlencoded base64 encoded security token.
  * @param SecurityTokenDecoder $signer The signer to use (configured in config.php)
  * @return SecurityToken An object representation of the token data.
  */
 public function validateToken($token, $signer)
 {
     if (count(explode(':', $token)) != 7) {
         $token = urldecode(base64_decode($token));
     }
     if (empty($token)) {
         throw new Exception("Missing or invalid security token");
     }
     return $signer->createToken($token);
 }
Пример #2
0
 /**
  * Validates a passed-in token.
  * 
  * @param string $token A urlencoded base64 encoded security token.
  * @param SecurityTokenDecoder $signer The signer to use (configured in config.php)
  * @return SecurityToken An object representation of the token data.
  */
 public function validateToken($token, $signer)
 {
     if (empty($token)) {
         throw new Exception("Missing or invalid security token");
     }
     return $signer->createToken($token);
 }