diff --git a/docs/controlling-token-scopes.md b/docs/controlling-token-scopes.md index d4e6274a..014b6e7c 100644 --- a/docs/controlling-token-scopes.md +++ b/docs/controlling-token-scopes.md @@ -33,3 +33,38 @@ App\EventListener\ScopeResolveListener: tags: - { name: kernel.event_listener, event: trikoder.oauth2.scope_resolve, method: onScopeResolve } ``` + +## Work with refresh token +The scopes created in this way will not be recognized by the library when trying to login using the `refresh_token` grant method. +In order to append new scopes, you need to override the service `Trikoder\Bundle\OAuth2Bundle\Manager\ScopeManagerInterface`. +Here is an example: +```yaml +# services.yaml +Trikoder\Bundle\OAuth2Bundle\Manager\ScopeManagerInterface: + alias: Path\To\Custom\Manager +``` +in the manager you can implement the business logic needed to validate the tokens you issued in the scope resolve listener +```php +