我已经安装了Laravel Passport(带有php artisan passport:install --uuids
)并尝试生成PAT。在执行此操作之前,必须创建个人客户端。
每当我跑步时:
php artisan passport:client --personal
将为我的数据库创建一个新客户端,但我收到以下错误:
IlluminateDatabaseQueryException
SQLSTATE[HY000]: General error: 1364 Field 'access_token_id' doesn't have a default value (SQL: insert into `oauth_refresh_tokens` (`client_id`) values (96cf1614-fe2e-42fa-83ba-ac804943c84b))
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:759
755▕ // If an exception occurs when attempting to run a query, we'll format the error
756▕ // message to include the bindings with SQL, which will make this exception a
757▕ // lot more helpful to the developer instead of just the database's errors.
758▕ catch (Exception $e) {
➜ 759▕ throw new QueryException(
760▕ $query, $this->prepareBindings($bindings), $e
761▕ );
762▕ }
763▕ }
+28 vendor frames
29 artisan:37
IlluminateFoundationConsoleKernel::handle()
我可以通过nullable
归咎字段来解决这个问题,我只是想知道是否有其他人对护照的 PAT 有同样的问题。
这是原始迁移:
public function up()
{
$this->schema->create('oauth_refresh_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
}
需要此更新才能使其正常工作:
public function up()
{
$this->schema->create('oauth_refresh_tokens', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->uuid('client_id')->nullable()->index();
$table->uuid('access_token_id')->nullable()->index();
$table->boolean('revoked')->nullable();
$table->dateTime('expires_at')->nullable();
});
}
更新
实施上述解决方法后,我运行
php artisan passport:client --personal --user_id=11111111-1111-1111-1111-111111111111 --name=PAT
..但user_id
在oauth_clients_table
中也没有关联:
id | user_id | name | secret | provider | redirect | personal_access_client | password_client |
---|---|---|---|
96cf9c98-97fa-494d-8f13-01a5856dbe3b | <td style="文本对齐:左;">PAT | $2y$... | http://localhost | 1 | 0 | 0 | 2022-07-18 22:44:56.0 | 2022-07-18 22:44:56.0 |
刷新数据库,然后使用此命令
php artisan passport:install
我有同样的问题,这救了我!
相关内容
- Firebase 在通过 FacebookAuthProvider.credential(access_token) 后抛出"Cannot parse ID Token"
- Token对id Token进行加密
- 缓存从Rails API (google-id-token)的HTTP请求?
- jwt.verify(token, process.env.JWT_Confirm_KEY).属性'id'在类型 'object' 上不存在
- Firebase ID token - JWT::VerificationError Exception:引发签名验证.
- 向受 IAP 保护的应用发送服务帐号请求会导致'Invalid GCIP ID token: JWT signature is invalid'
- 如何在Angular中使用httpParams从路由练习中提取token和id ?
- id-token在GitHub Action中的权限范围是什么?
- 使用space根据token id提取张量
- 在Spring Boot中使用Firebase Id Token对用户进行身份验证
- Expressjs:google-auth-library id-token verification "token used too late number > number..."
- 为什么我在使用Access Token时会得到一个HTML页面作为响应,而在使用ID Token时会收到所需的结果?(A
- ID组件可能不包括未解析的令牌:使用CfnParameter时,${Token[Token.199]}-ec2
- { "Unexpected JSON token when reading DataTable. Expected StartArray, got Integer. Path 'id', line
- "At least one of ID token and access token is required" Google 登录流程与 Firebase 模拟器套件
- 如何从Token中获取用户ID
- Access Azure WebApp with Powershell { "message" : "Missing id token. Unauthorized." }
- 如何在Ruby on Rails服务器上验证从Android发送的Google Token ID?
- Nuget:"The replacement token 'id' has no value"
- 如何检查网络安全'Password Reset Token ID'有效性?
最新更新
- 自动伸缩组实例未在ALB上注册
- 我有一个问题与基础SQLITE3,如何解决它?
- react useEffect(): Hello只记录一次
- ViewBinding within Broadcast Receiver
- 为什么x输入事件不再被Tk事件回调处理(Ubuntu 22.04, Tk 8.6.12)?
- 如何降低MSAA内存使用率?
- Apache Flink -匹配具有相同值的字段
- 如何在jquery中添加?
- 如何在AVAudioPCMBuffer上做偏移?
- 定义函数以返回类的属性需要什么?
- Php对象组数组
- 如何用Angular/Javascript创建工作流图
- 颤镖"unconditionally accessed because the receiver can be 'null'."问题
- 无法从'pydantic'(未知位置)导入名称'BaseModel'
- 处理多个实例上的websocket连接
- r语言 - 如何使用随机生成的数据对ridge/lasso回归进行交叉验证?
- Julia通过关键字参数的数量来识别方法
- Firebase 函数部署失败,并出现"缺少"依赖项错误
- 使用通配符复制文件 * 为什么它不起作用?
- c语言 - 如果我只在以"rb"模式打开的文件的情况下使用它,将 fgetc() 结果转换为 short 是否安全?
- 增加lambda函数中的值
- 读取文件夹内的多个docx文件到多个数据帧时出错
- 为什么servlet显示内部错误500
- 在getJsonRawBody期间Phalcon 4数据的奇怪符号
- c -从optarg中获取int
- 我如何定义一个CHECK约束来强制一个值的最小3个实例的规则?
- React native <View> 在 if 语句中不起作用
- 以编程方式切换excel中的功能区选项卡
- Wordpress & Vue & Nuxt - Integration - wp_enqueue_script
- 为什么express-mysql-session写入数据库,但不知何故不从它读取?
热门标签:
javascript python java c# php android html jquery c++ css ios sql mysql arrays asp.net json python-3.x ruby-on-rails .net sql-server django objective-c excel regex ruby linux ajax iphone xml vba spring asp.net-mvc database wordpress string postgresql wpf windows xcode bash git oracle list vb.net multithreading eclipse algorithm macos powershell visual-studio image forms numpy scala function api selenium