yii2-usuario
yii2-usuario copied to clipboard
Invalid auth state parameter for google auth
I was able to login yesterday, today it stopped working.
What steps will reproduce the problem?
when i try to login to google, i'm redirected to
https://localhost/yii2/frontend/web/index.php?r=user%2Fsecurity%2Fauth&authclient=google&state=a210c7124891a0083463a&code=4%2F0AX4XfWgAhMrw6CVtm4cj8-&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=none
i get a 400 Invalid auth state parameter. error
on chrome i get the 400 error page immediately, on firefox i only get the 400 error after i choose which gmail account i want to login in with.
i'm also using yii\web\DbSession
What do you get instead?
yii\web\HttpException: Invalid auth state parameter. in C:\xampp\htdocs\yii2\vendor\yiisoft\yii2-authclient\src\OAuth2.php:122
Stack trace:
#0 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2-authclient\src\AuthAction.php(417): yii\authclient\OAuth2->fetchAccessToken('4/0AX4XfWgAhMrw...')
#1 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2-authclient\src\AuthAction.php(227): yii\authclient\AuthAction->authOAuth2(Object(Da\User\AuthClient\Google), Array)
#2 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2-authclient\src\AuthAction.php(210): yii\authclient\AuthAction->auth(Object(Da\User\AuthClient\Google))
#3 [internal function]: yii\authclient\AuthAction->run()
#4 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2\base\Action.php(94): call_user_func_array(Array, Array)
#5 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\Action->runWithParams(Array)
#6 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2\base\Module.php(534): yii\base\Controller->runAction('auth', Array)
#7 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('user/security/a...', Array)
#8 C:\xampp\htdocs\yii2\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))
#9 C:\xampp\htdocs\yii2\frontend\web\index.php(39): yii\base\Application->run()
#10 {main}
Additional info
| Q | A |
|---|---|
| Yii version | 2.0.42.1 |
| Yii Auth Client version | 2.2 |
| PHP version | 8.0.8 |
| Operating system | Windows 10 |