'Field Kit', 'client_id' => 'fieldkit', 'redirect' => 'https://farmOS.app', 'allowed_origins' => 'https://farmos.app', 'owner_id' => '', 'secret' => '', 'confidential' => FALSE, 'third_party' => FALSE, 'grant_user_access' => TRUE, 'limit_user_access' => TRUE, 'limit_requested_access' => FALSE, ]); $fk_consumer->save(); } /** * Implements hook_uninstall(). */ function farm_fieldkit_uninstall() { // Load the fieldkit consumer. $consumers = \Drupal::entityTypeManager()->getStorage('consumer') ->loadByProperties(['client_id' => 'fieldkit']); // If found, delete the consumer. if (!empty($consumers)) { $client_consumer = reset($consumers); $client_consumer->delete(); } }