gpt4 book ai didi

ruby-on-rails - doorkeeper gem 在成功验证用户名和密码后给出 "invalid_client"

转载 作者:行者123 更新时间:2023-12-05 01:29:09 27 4
gpt4 key购买 nike

http://localhost:3000/oauth/token

{
"error": "invalid_client",
"error_description": "Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."
}

在实现门卫时..

于 2021-06-13 19:56:20 +0530 开始为::1 发布“/oauth/token”Doorkeeper 处理::TokensController#create as /参数:{"grant_type"=>"password", "username"=>"bhagwan", "password"=>"[FILTERED]"}用户负载 (7.0ms) SELECT "users". FROM "users"WHERE "users"."email"= ?限制 ? [[“电子邮件”,“bhagwan”],[“LIMIT”,1]]↳ config/initializers/doorkeeper.rb:19:in `block (2 levels) in '在 1654 毫秒内完成 401 未经授权( View :0.5 毫秒 | ActiveRecord:28.7 毫秒 | 分配:5869)*

在 doorkeeper.rb 中

grant_flows %w[password]

resource_owner_from_credentials do
User.find_by(email: params[:username])
&.authenticate(params[:password]) || nil
end

最佳答案

您可以使用 skip_client_authentication_for_password_grant 配置选项为您的案例跳过客户端身份验证:

Doorkeeper.configure do
skip_client_authentication_for_password_grant true
end

关于ruby-on-rails - doorkeeper gem 在成功验证用户名和密码后给出 "invalid_client",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67966664/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com