AWS Cognito adminSetUserPassword返回“用户不存在”。当用户肯定在游泳池中时

时间:2019-05-30 12:26:53

标签: php amazon-cognito aws-php-sdk

调用以下代码时,它将返回异常

$this->client->adminSetUserPassword([
                'Password'          => $password,
                'Permanent'         => true,
                'UserPoolId'        => $this->poolId,
                'Username'          => $email,
            ]);

-errorCode: "UserNotFoundException"
-errorMessage: "User does not exist."

我正在其他地方使用类似的管理员级别请求,如下所示...

$result = $this->client->adminDeleteUser([
                    'UserPoolId' => $this->poolId,
                    'Username'   => $email,
                ]);

$result = $this->client->adminDisableUser([
                'UserPoolId' => $this->poolId,
                'Username'   => $email,
            ]);

$response = $this->client->adminInitiateAuth([
                'AuthFlow'       => 'ADMIN_NO_SRP_AUTH',
                'AuthParameters' => [
                    'USERNAME'     => $email,
                    'PASSWORD'     => $password,
                    'SECRET_HASH'  => $this->cognitoSecretHash($email),
                ],
                'ClientId'   => $this->clientId,
                'UserPoolId' => $this->poolId,
            ]);

所有这些方法以及其他方法都可以与用户正常工作,但是尽管用户确实在我的用户池中,但是新的adminSetUserPassword方法似乎失败了。

0 个答案:

没有答案