mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Generalized access token format
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user