oauth\u access\u token表中插入了错误的值

5uzkadbs  于 2021-06-17  发布在  Mysql
关注(0)|答案(1)|浏览(292)

我正在我的laravel应用程序中设置laravel passport,当我执行 Request::create/oauth/token 而laravel/passport只需将我的用户名插入错误的列( user_id )在表中 oauth_access_tokens .
sqlstate[22007]:无效的日期时间格式:1366不正确的整数值:第1行“user\u id”列的“admin”(sql:insert-into) oauth_access_tokens ( id , user_id , client_id , scopes , revoked , created_at , updated_at , expires_at )值(720b884efdcc52f13bc1af44703fab477eb37731404104b9da90d9c9e9164809c0fe754b74fc6814,管理员,2,[],0,2019-01-04 06:11:32,2019-01-04 06:11:32,2019-01-04 06:26:32))
请注意,我的用户表没有典型的电子邮件/密码。这是现有的数据库,我必须构建每个表的模型。基本上我有如下字段名
us\U用户名
us\u password~现有数据库使用md5对其进行哈希运算,因此我创建了一个自定义提供程序
美国电子邮件
我就是这样称呼这个请求的 /oauth/token ```
$data = [
'grant_type' => 'password',
'client_id' => $client->id,
'client_secret' => $client->secret,
'username' => request('us_username'),
'password' => request('password'),
'scope' => '',
];

$reqwest = Request::create('/oauth/token', 'POST', $data);

我希望它像往常一样插入,因为我可以像往常一样通过web界面登录。
pftdvrlh

pftdvrlh1#

看起来$client->id有一个'admin'值。。
检查为什么$client->id值是admin。。可能是因为您的输入或数据库中的用户表

相关问题