You are here

function farm_api_update_7002 in farmOS 7

Enable default farmOS OAuth client.

File

modules/farm/farm_api/farm_api.install, line 105
Farm API install file.

Code

function farm_api_update_7002(&$sandbox) {
  $label = 'farmOS (Default)';
  $client_key = 'farm';
  $client_secret = '';
  $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,
  );
  farm_api_enable_oauth_client($label, $client_key, $client_secret, $redirect_uri, $settings);
}