I am trying to set a password for a Cognito user that I have already created using the AdminSetUserPassword function, but I keep getting "Operation not found: AdminSetUserPassword" as response.
I have checked the version of CognitoIdentityProvider ('2016-04-18'), which doesn't seem to be the problem. I have also tried to go around it using AdminInitiateAuth and AdminRespondToAuthChallenge, but the problem with the InitiateAuth function is that I get no 'Session' in response! Any help would be greatly appreciated!
$args = [
'credentials' => *CREDENTIALS*,
'region' => 'eu-central-1',
'version' => 'latest',
'app_client_id' => *CLIENT_ID*,
'user_pool_id' => *USER_POOL_ID*,
];
$client = new CognitoIdentityProviderClient($args);
try {
$response = $client->adminSetUserPassword([
"Password" => $new_password,
"Permanent" => true,
"Username" => *USER_USERNAME*,
"UserPoolId" => *USER_POOL_ID*
]);
return true;
} catch (Exception $e) {
return false;
}