Open BenKennish opened 4 years ago
Oh btw I obtained aws-cognito using Composer and it retrieved version 0.2.11 which seems to be the latest version
Hi @BenKennish
$username must be the value of Username returned by the getUser method, not an email.
Ivy
Thanks @ivy-liu09. Could this be considered a bug in aws-cognito? All the other example scripts accept the email 'username' and also the error message "Unable to verify secret hash for client" seems inappropriate.
I am getting a fatal error when the password is wrong:
Fatal error: Uncaught exception 'Aws\CognitoIdentityProvider\Exception\CognitoIdentityProviderException' with message 'Error executing "AdminInitiateAuth" on "https://cognito-idp.us-east-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://cognito-idp.us-east-1.amazonaws.com` resulted in a `400 Bad Request` response: {"__type":"NotAuthorizedException","message":"Incorrect username or password."} NotAuthorizedException (client): Incorrect username or password. - {"__type":"NotAuthorizedException","message":"Incorrect username or password."}' GuzzleHttp\Exception\ClientException: Client error: `POST https://cognito-idp.us-east-1.amazonaws.com` resulted in a `400 Bad Request` response: {"__type":"NotAuthorizedException","message":"Incorrect username or password."} in /Applications/MAMP/htdocs/app/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 Stack trace: #0
Shouldn't I get an object saying that was bad request instead of a fatal error? In that way it would be possible to return to the user such information.
I can get all the other example scripts working as expected but
refreshAuthentication.php
doesn't seem to work for me....I then edit refreshAuthentication.php and put in the same value for
$username
as I used inlogin.php
and with$refreshToken
set to the RefreshToken I received above (starting eyJjd and ending 4aQ) and I get...This is the same exception message that
login.php
generates if the 'app_client_secret' inconfig.php
is incorrect but it IS currently correct aslogin.php
is working as expected.Anyone know what I'm doing wrong? Cheers, Ben