Skip to content

Commit 0e7586f

Browse files
committed
feat: allow configuring revocation of refresh tokens
fixes #211
1 parent 161ba05 commit 0e7586f

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ For implementation into Symfony projects, please see [bundle documentation](basi
7575
# Whether to enable access token saving to persistence layer (default to true)
7676
persist_access_token: true
7777
78+
# Whether to revoke refresh tokens after they were used for all grant types (default to true)
79+
revoke_refresh_tokens: true
80+
7881
resource_server: # Required
7982
8083
# Full path to the public key file

src/DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ private function createAuthorizationServerNode(): NodeDefinition
111111
->info('Define a custom ResponseType')
112112
->defaultValue(null)
113113
->end()
114+
->booleanNode('revoke_refresh_tokens')
115+
->info('Whether to revoke refresh tokens after they were used for all grant types')
116+
->defaultTrue()
117+
->end()
114118
->end()
115119
;
116120

src/DependencyInjection/LeagueOAuth2ServerExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ private function configureAuthorizationServer(ContainerBuilder $container, array
148148
$authorizationServer->replaceArgument(5, new Reference($config['response_type_class']));
149149
}
150150

151+
if ($config['revoke_refresh_tokens']) {
152+
$authorizationServer->addMethodCall('revokeRefreshTokens', [
153+
$config['revoke_refresh_tokens'],
154+
]);
155+
}
156+
151157
if ($config['enable_client_credentials_grant']) {
152158
$authorizationServer->addMethodCall('enableGrantType', [
153159
new Reference(ClientCredentialsGrant::class),

0 commit comments

Comments
 (0)