用户池客户端 {id} 不存在

问题描述

这是我的代码

 use Aws\CognitoIdentityProvider\CognitoIdentityProviderClient;

$args = [ 
    'credentials' => [
        'key'    => 'valid','secret' => 'valid',],'region' => 'us-west-2','version' => 'latest','app_client_id' => 'valid','app_client_secret' => 'valid','user_pool_id' => 'valid',];

$email = '[email protected]';

$client = new CognitoIdentityProviderClient($args);
$hash_key = cognitoSecretHash($email);

$login =  $client->adminInitiateAuth([
            'AuthFlow' => 'ADMIN_NO_SRP_AUTH','AuthParameters' => [
                'Username' => $email,'Password' => '12345678','SecretHash' => $hash_key,'ClientId' => 'valid','UserPoolId' => 'valid',]);

return $login;


 function cognitoSecretHash($username)
{
    $message = $username . 'app_client_id';

    $hash = hash_hmac(
        'sha256',$message,'app_client_secret',true
    );

    return base64_encode($hash);
}

它给了我这个错误

致命错误:未捕获的异常“Aws\CognitoIdentityProvider\Exception\CognitoIdentityProviderException”,消息为“在“https://cognito-idp.us-west-2.amazonaws.com”上执行“AdminInitiateAuth”时出错; AWS HTTP 错误:客户端错误POST https://cognito-idp.us-west-2.amazonaws.com 导致 400 Bad Request 响应:{"__type":"ResourceNotFoundException","message":"用户池客户端 {id} 不存在。"} ResourceNotFoundException (客户端):用户池客户端 {id} 不存在。 - {"__type":"ResourceNotFoundException","message":"用户池客户端 {id} 不存在。"}' GuzzleHttp\Exception\ClientException:客户端错误POST https://cognito-idp.us-west-2.amazonaws.com 导致 400 Bad Request响应:{"__type":"ResourceNotFoundException","message":"用户池客户端 {id} 不存在。"} 在 D:\xampp\htdocs\test\vendor\guzzlehttp\guzzle\src\Exception\RequestException。 PHP:113 堆栈跟踪:#0 D:\xampp\htdocs\test\vend 在 D:\xampp\htdocs\test\vendor\aws\aws-sdk-PHP\src\WrappedHttpHandler.PHP 在线 195

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)