You are here

public function MiniorangeSAMLCustomer::sendOtp in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

Send OTP.

File

src/MiniorangeSAMLCustomer.php, line 88
Contains miniOrange Customer class.

Class

MiniorangeSAMLCustomer

Namespace

Drupal\miniorange_saml

Code

public function sendOtp() {
  $url = MiniorangeSAMLConstants::AUTH_CHALLENGE_API;
  $username = \Drupal::config('miniorange_saml.settings')
    ->get('miniorange_saml_customer_admin_email');
  $fields = array(
    'customerKey' => MiniorangeSAMLConstants::DEFAULT_CUSTOMER_ID,
    'email' => $username,
    'authType' => 'EMAIL',
  );
  $api = new MoAuthApi();
  $header = $api
    ->getHttpHeaderArray();
  return $api
    ->makeCurlCall($url, $fields, $header);
}