manage responseHeader
This commit is contained in:
parent
6af3e337c4
commit
53c9df92f4
|
@ -209,6 +209,33 @@ class Authenticator
|
|||
return new Token($this->config['type'], $key, $date, $tokenValue, $noise);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @method generateResponseHeader
|
||||
* @public
|
||||
* @param MetaTech\PwsAuth\Token $token
|
||||
* @param str $login
|
||||
* @return str
|
||||
*/
|
||||
public function generateResponseHeader(Token $token, $login)
|
||||
{
|
||||
return hash(
|
||||
self::DEFAULT_ALGO,
|
||||
$this->formatDate($token->getDate()) . $this->getUserSalt($login) . $token->getValue()
|
||||
);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @method checkResponseHeader
|
||||
* @public
|
||||
* @param MetaTech\PwsAuth\Token $token
|
||||
* @param str $login
|
||||
* @return []
|
||||
*/
|
||||
public function checkResponseHeader(Token $token, $login, $responseToken)
|
||||
{
|
||||
return $this->generateResponseHeader($token, $login) == $responseToken;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @method generateHeader
|
||||
* @public
|
||||
|
|
Loading…
Reference in New Issue
Block a user