You are here

public function UsersAPIHandler::get in Google Authenticator / 2 Factor Authentication - 2FA 8.2

Same name and namespace in other branches
  1. 8 src/UsersAPIHandler.php \Drupal\miniorange_2fa\UsersAPIHandler::get()

File

src/UsersAPIHandler.php, line 29

Class

UsersAPIHandler

Namespace

Drupal\miniorange_2fa

Code

public function get(MiniorangeUser $user) {
  $fields = array(
    'customerKey' => $user
      ->getCustomerId(),
    'username' => $user
      ->getUsername(),
  );
  $json = json_encode($fields);
  $url = MoAuthConstants::getBaseUrl() . MoAuthConstants::$USERS_GET_API;
  return MoAuthUtilities::callService($this->customerId, $this->apiKey, $url, $json);
}