Php AWS-Cognito-AdminSetUserPassword返回;未找到操作:AdminSetUserPassword";
我试图为我已经使用AdminSetUserPassword函数创建的Cognito用户设置密码,但是我一直得到“Operation not found:AdminSetUserPassword”作为响应 我已经检查了CognitoIdentityProvider(“2016-04-18”)的版本,这似乎不是问题所在。我还尝试使用AdminInitiateAuth和AdminRespondToAuthChallenge绕过它,但是InitiateAuth函数的问题是我没有得到任何“会话”响应! 任何帮助都将不胜感激Php AWS-Cognito-AdminSetUserPassword返回;未找到操作:AdminSetUserPassword";,php,amazon-web-services,aws-sdk,amazon-cognito,Php,Amazon Web Services,Aws Sdk,Amazon Cognito,我试图为我已经使用AdminSetUserPassword函数创建的Cognito用户设置密码,但是我一直得到“Operation not found:AdminSetUserPassword”作为响应 我已经检查了CognitoIdentityProvider(“2016-04-18”)的版本,这似乎不是问题所在。我还尝试使用AdminInitiateAuth和AdminRespondToAuthChallenge绕过它,但是InitiateAuth函数的问题是我没有得到任何“会话”响应! 任
$args=[
“凭证”=>*凭证*,
'地区'=>'欧盟中部-1',
'版本'=>'最新',
“应用程序客户端id”=>*客户端id*,
'user\u pool\u id'=>*user\u pool\u id*,
];
$client=新CognitoIdentityProviderClient($args);
试一试{
$response=$client->adminSetUserPassword([
“密码”=>$new\u密码,
“永久”=>正确,
“用户名”=>*用户\用户名*,
“UserPoolId”=>*用户\u池\u ID*
]);
返回true;
}捕获(例外$e){
返回false;
}
AdminSetUserPassword
仅在版本中添加到aws/aws sdk php
包中。您可以使用composer require aws/aws sdk php:“>3.93.3”
更新您的软件包版本。您是否使用composer安装了该软件包?如果是这样,当您运行composer info aws/aws sdk php
时,在versions
下会得到什么?@Delena Malan我在versions下会得到3.68.1谢谢!更新后,它工作得很好!没问题@S.P.S!您可以将答案标记为好像它回答了您的问题。:)