mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Use the new access token covertToJWT method
This commit is contained in:
parent
ad270f7d9d
commit
0d0aaa8764
@ -29,16 +29,7 @@ class BearerTokenResponse extends AbstractResponseType
|
||||
{
|
||||
$expireDateTime = $this->accessToken->getExpiryDateTime()->getTimestamp();
|
||||
|
||||
$jwtAccessToken = (new Builder())
|
||||
->setAudience($this->accessToken->getClient()->getIdentifier())
|
||||
->setId($this->accessToken->getIdentifier(), true)
|
||||
->setIssuedAt(time())
|
||||
->setNotBefore(time())
|
||||
->setExpiration($expireDateTime)
|
||||
->setSubject($this->accessToken->getUserIdentifier())
|
||||
->set('scopes', $this->accessToken->getScopes())
|
||||
->sign(new Sha256(), new Key($this->pathToPrivateKey))
|
||||
->getToken();
|
||||
$jwtAccessToken = $this->accessToken->convertToJWT($this->pathToPrivateKey);
|
||||
|
||||
$responseParams = [
|
||||
'token_type' => 'Bearer',
|
||||
|
Loading…
Reference in New Issue
Block a user