我正在使用yii2authclient扩展
yii2-usuario
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
我得到400分
Invalid auth state parameter.
错误
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}
我也在使用
yii\web\DbSession
yii\web\dbession
到
yii\web\Session
yii\web\dbession
?
我的会话表如下所示
CREATE TABLE `yiisession` (
`id` char(40) NOT NULL,
`expire` int(11) NOT NULL,
`data` longblob NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
main.php
'session' => [
'class' => 'yii\web\DbSession',
'sessionTable' => 'yiisession',
]
附加信息
使现代化
我的数据库连接
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yii2',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
CREATE TABLE `session` (
`id` char(40) NOT NULL,
`expire` int(11) DEFAULT NULL,
`data` longblob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
身份证应该是一样的吗?当我进入我的联系人页面时,我得到了这个信息。当我提交联系人表单时,闪光灯不会出现。