This method is called right before an access token or authorization code is created.
Given a client, grant type and optional user identifier validate the set of scopes requested are valid and optionally append additional scopes or remove requested scopes.
This method is useful for integrating with your own app's permissions system.