resync_mfa_device ( $user_name, $serial_number, $authentication_code1, $authentication_code2, $opt )

Synchronizes the specified MFA device with AWS servers.

Access

public

Parameters

Parameter

Type

Required

Description

$user_name

string

Required

Name of the user whose MFA device you want to resynchronize. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\w+=,.@-]*]

$serial_number

string

Required

Serial number that uniquely identifies the MFA device. [Constraints: The value must be between 9 and 256 characters, and must match the following regular expression pattern: [\w+=/:,.@-]*]

$authentication_code1

string

Required

An authentication code emitted by the device. [Constraints: The value must be between 6 and 6 characters, and must match the following regular expression pattern: [\d]*]

$authentication_code2

string

Required

A subsequent authentication code emitted by the device. [Constraints: The value must be between 6 and 6 characters, and must match the following regular expression pattern: [\d]*]

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Resyncs a multi-factor authentication device.

Learn more about multi-factor authentication at aws.amazon.com/mfa.

// Instantiate the class
$iam = new AmazonIAM();

$response = $iam->resync_mfa_device('johndoe2', CFCredentials::get('@default')->mfa_serial, '123456', '987654');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/iam.class.php | Toggle source view (10 lines) | View on GitHub

public function resync_mfa_device($user_name, $serial_number, $authentication_code1, $authentication_code2, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['UserName'] = $user_name;
    $opt['SerialNumber'] = $serial_number;
    $opt['AuthenticationCode1'] = $authentication_code1;
    $opt['AuthenticationCode2'] = $authentication_code2;
    
    return $this->authenticate('ResyncMFADevice', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback