-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in CognitoTokenGuard.php:147 #114
Comments
Same here! The problem is on this lines
for some reasons, |
To solve the problem, I override the AwsCognitoServiceProvider and create an overriden class of CognitoTokenGuard private function processCognitoChallenge(Collection $result, string $username)
{
$result = $result->toArray();
//Return value
$returnValue = null;
switch ($result['ChallengeName']) {
case 'SOFTWARE_TOKEN_MFA':
$returnValue = [
'status' => $result['ChallengeName'],
'session_token' => $result['Session'],
'username' => $username
];
break;
case 'SMS_MFA':
case 'SELECT_MFA_TYPE':
$returnValue = [
'status' => $result['ChallengeName'],
'session_token' => $result['Session'],
'challenge_params' => $result['ChallengeParameters'],
'username' => $username
];
break;
default:
if (in_array($result['ChallengeName'], config('cognito.forced_challenge_names'))) {
$returnValue =
[
'status' => $result['ChallengeName'],
'challenge_params' => isset($result['ChallengeParameters']) ? $result['ChallengeParameters'] : null,
'username' => $username
];
} //End if
break;
} //End switch
return $returnValue;
} //Function ends Then I handle the response in my Controller |
Hi,
I am trying to integrate the package in Laravel 9 with API guard.
After registering new user, the status of new user in Cognito is "Force change password"
When I am performing the Login with API Guard, a crash occurs in CognitoTokenGuard.php at line 147.
After debugging, following variables have values:
The error is
There is no 'session_token' in the array.
I think I am doing something wrong but can you help me please?
Best regards
Sebastien
The text was updated successfully, but these errors were encountered: