Generalized access token format

This commit is contained in:
Lukáš Unger
2018-03-15 14:27:37 +01:00
parent 35c6f28aef
commit fd72d79ad3
5 changed files with 25 additions and 6 deletions

View File

@@ -22,4 +22,13 @@ interface AccessTokenEntityInterface extends TokenInterface
* @return Token
*/
public function convertToJWT(CryptKey $privateKey);
/**
* Generate a string representation from the access token
*
* @param CryptKey $privateKey
*
* @return string
*/
public function getResponseString(CryptKey $privateKey);
}

View File

@@ -40,6 +40,18 @@ trait AccessTokenTrait
->getToken();
}
/**
* Generate a string representation from the access token
*
* @param CryptKey $privateKey
*
* @return string
*/
public function getResponseString(CryptKey $privateKey)
{
return (string) $this->convertToJWT($privateKey);
}
/**
* @return ClientEntityInterface
*/