Uset sub instead of uid

This commit is contained in:
Alex Bilbie 2016-01-13 00:38:08 +00:00
parent 70e9d7b699
commit c1d15aa15c

View File

@ -30,7 +30,7 @@ class BearerTokenResponse extends AbstractResponseType
->setIssuedAt(time()) ->setIssuedAt(time())
->setNotBefore(time()) ->setNotBefore(time())
->setExpiration($this->accessToken->getExpiryDateTime()->getTimestamp()) ->setExpiration($this->accessToken->getExpiryDateTime()->getTimestamp())
->set('uid', $this->accessToken->getUserIdentifier()) ->setSubject($this->accessToken->getUserIdentifier())
->set('scopes', $this->accessToken->getScopes()) ->set('scopes', $this->accessToken->getScopes())
->sign(new Sha256(), new Key($this->pathToPrivateKey)) ->sign(new Sha256(), new Key($this->pathToPrivateKey))
->getToken(); ->getToken();
@ -47,7 +47,8 @@ class BearerTokenResponse extends AbstractResponseType
->setIssuedAt(time()) ->setIssuedAt(time())
->setNotBefore(time()) ->setNotBefore(time())
->setExpiration($this->refreshToken->getExpiryDateTime()->getTimestamp()) ->setExpiration($this->refreshToken->getExpiryDateTime()->getTimestamp())
->set('uid', $this->accessToken->getUserIdentifier()) ->set('type', 'refreshToken')
->setSubject($this->accessToken->getUserIdentifier())
->set('scopes', $this->accessToken->getScopes()) ->set('scopes', $this->accessToken->getScopes())
->set('accessToken', $this->accessToken->getIdentifier()) ->set('accessToken', $this->accessToken->getIdentifier())
->sign(new Sha256(), new Key($this->pathToPrivateKey)) ->sign(new Sha256(), new Key($this->pathToPrivateKey))