Server constructor expects path to private key

This commit is contained in:
Alex Bilbie 2016-01-12 23:03:24 +00:00
parent 2a20de991b
commit e03ad0d52f

View File

@ -48,10 +48,12 @@ class Server implements EmitterAwareInterface
/** /**
* New server instance * New server instance
*
* @param string $pathToPrivateKey
*/ */
public function __construct() public function __construct($pathToPrivateKey)
{ {
$this->setDefaultResponseType(new BearerTokenResponse()); $this->setDefaultResponseType(new BearerTokenResponse($pathToPrivateKey));
$this->setDefaultAccessTokenTTL(new DateInterval('PT01H')); // default token TTL of 1 hour $this->setDefaultAccessTokenTTL(new DateInterval('PT01H')); // default token TTL of 1 hour
} }
@ -89,7 +91,7 @@ class Server implements EmitterAwareInterface
* Enable a grant type on the server * Enable a grant type on the server
* *
* @param \League\OAuth2\Server\Grant\GrantTypeInterface $grantType * @param \League\OAuth2\Server\Grant\GrantTypeInterface $grantType
* @param ResponseTypeInterface $responseType * @param ResponseTypeInterface $responseType
* @param DateInterval $accessTokenTTL * @param DateInterval $accessTokenTTL
*/ */
public function enableGrantType( public function enableGrantType(