Skip to content

Latest commit

 

History

History
200 lines (131 loc) · 5.19 KB

MFAApi.md

File metadata and controls

200 lines (131 loc) · 5.19 KB

MailInABoxAPI\Client\MFAApi

All URIs are relative to https://box.example.com/admin

Method HTTP request Description
mfaStatus POST /mfa/status Retrieve MFA status for you or another user
mfaTotpDisable POST /mfa/disable Disable multi-factor authentication for you or another user
mfaTotpEnable POST /mfa/totp/enable Enable TOTP authentication

mfaStatus

\MailInABoxAPI\Client\Model\MfaStatusResponse mfaStatus()

Retrieve MFA status for you or another user

Retrieves which type of MFA is used and configuration

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new MailInABoxAPI\Client\Api\MFAApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->mfaStatus();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MFAApi->mfaStatus: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\MailInABoxAPI\Client\Model\MfaStatusResponse

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/html

[Back to top] [Back to API list] [Back to Model list] [Back to README]

mfaTotpDisable

string mfaTotpDisable($mfaId)

Disable multi-factor authentication for you or another user

Disables multi-factor authentication for the currently logged-in admin user or another user if a 'user' parameter is submitted. Either disables all multi-factor authentication methods or the method corresponding to the optional property mfa_id.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new MailInABoxAPI\Client\Api\MFAApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$mfaId = 'mfaId_example'; // string | 

try {
    $result = $apiInstance->mfaTotpDisable($mfaId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MFAApi->mfaTotpDisable: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
mfaId string [optional]

Return type

string

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: text/html

[Back to top] [Back to API list] [Back to Model list] [Back to README]

mfaTotpEnable

string mfaTotpEnable($secret, $code, $label)

Enable TOTP authentication

Enables TOTP authentication for the currently logged-in admin user

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new MailInABoxAPI\Client\Api\MFAApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$secret = 'secret_example'; // string | 
$code = 'code_example'; // string | 
$label = 'label_example'; // string | 

try {
    $result = $apiInstance->mfaTotpEnable($secret, $code, $label);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MFAApi->mfaTotpEnable: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
secret string
code string
label string [optional]

Return type

string

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: text/html

[Back to top] [Back to API list] [Back to Model list] [Back to README]