mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Clarified example
This commit is contained in:
parent
0178a837d4
commit
88b01b792a
@ -37,10 +37,13 @@ $app = new App([
|
|||||||
$publicKeyPath
|
$publicKeyPath
|
||||||
);
|
);
|
||||||
|
|
||||||
// Enable the refresh token grant on the server with a token TTL of 1 hour
|
// Enable the refresh token grant on the server
|
||||||
|
$grant = new RefreshTokenGrant($refreshTokenRepository);
|
||||||
|
$grant->setRefreshTokenTTL(new \DateInterval('P1M')); // The refresh token will expire in 1 month
|
||||||
|
|
||||||
$server->enableGrantType(
|
$server->enableGrantType(
|
||||||
new RefreshTokenGrant($refreshTokenRepository),
|
$grant,
|
||||||
new \DateInterval('PT1H')
|
new \DateInterval('PT1H') // The new access token will expire after 1 hour
|
||||||
);
|
);
|
||||||
|
|
||||||
return $server;
|
return $server;
|
||||||
|
Loading…
Reference in New Issue
Block a user