function hook_oauth2_server_grant_types_alter in OAuth2 Server 7
Alter the list of available grant types.
Parameters
array &$grant_types: The grant types available for any OAuth2 servers. Each grant type is an array containing a 'name' and a 'class'. The 'class' is the name of a grant type class that implements \OAuth2\GrantType\GrantTypeInterface.
File
- ./
oauth2_server.api.php, line 112 - Hooks provided by the OAuth2 Server module.
Code
function hook_oauth2_server_grant_types_alter(&$grant_types) {
$grant_types['custom_grant_type'] = array(
'name' => t('Custom grant type'),
'class' => 'MyModuleCustomGrantType',
);
}