Provide a farmOS Default OAuth client.

This commit is contained in:
Paul Weidner 2020-04-24 09:22:45 -07:00 committed by Michael Stenta
parent 41283012d7
commit 6a872fc88c
1 changed files with 26 additions and 0 deletions

View File

@ -50,6 +50,32 @@ function farm_api_menu() {
return $items;
}
/*
* Implements hook_farm_api_oauth2_client()
*/
function farm_api_farm_api_oauth2_client() {
$clients = array();
// Provide default farmOS OAuth Client for general use.
$clients['farm'] = array(
'label' => 'farmOS (Default)',
'client_key' => 'farm',
'redirect_uri' => '',
'settings' => array(
'override_grant_types' => TRUE,
'allow_implicit' => FALSE,
'grant_types' => array(
'password' => 'password',
'refresh_token' => 'refresh_token',
),
'always_issue_new_refresh_token' => TRUE,
'unset_refresh_token_after_use' => TRUE,
)
);
return $clients;
}
/**
* Farm info API callback.
*/