Laravel Passport基本api身份验证返回“错误":"invalid_client",“消息":“客户端身份验证失败"; [英] Laravel Passport basic api auth returns "error":"invalid_client","message":"Client authentication failed"

查看:1320
本文介绍了Laravel Passport基本api身份验证返回“错误":"invalid_client",“消息":“客户端身份验证失败";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题

我一直在尝试使用Laravel Passport,并且无数地收到错误{"error":"invalid_client","message":客户端身份验证失败"}.我已经在 Android和Laravel 项目中使用了它,但我可以正确注册用户正如我在数据库中看到的正确数据一样.然后,当Android应用尝试获取访问令牌时,它会崩溃,因为服务器返回了先前的错误消息.

The Problem

I've been trying to use Laravel Passport and I'm countinously getting the error {"error":"invalid_client","message":"Client authentication failed"}. I have used it in this Android and Laravel project but I just can register the user correctly as I see the proper data in the database. Then when the Android app tries to get the access token it crashes because the server return the previous error message.

我也一直在关注 YouTube教程完全如其解释,但在发送访问令牌请求"的部分出现了此错误.

I have also been following this YouTube tutorial exactly as it is explained but I got this error at the part it sends the "access token request".

邮递员数据

oauth_clients表

我尝试使用此堆栈溢出来解决此问题.页面,此 GitHub 和许多其他网页页面,但是没有用

I have tried to fix this using this Stack Overflow page, this GitHub and many other webpages page but nothing worked

  • 我认为这可能与我的laravel版本不兼容 和护照(见下文).我已将laravel版本手动更改为5.4,但我 遇到了作曲家错误.我不想重新安装laravel,因为我认为我 可能会使我所有的laravel项目崩溃.

  • I think that it might be the uncompatibility of my laravel version and passport (see below). I have manually changed laravel version to 5.4 but I got a composer error. I don't want to reinstall laravel because i think I could crash all my laravel projects.

"user_id"列必须由laravel填充(我手动 将其更改为用户的user_id,然后将其还原为 零)

The 'user_id' column has to be populated by laravel (I have manually changed it to the user_id of the user and after that I restored it to zero)

如何将数据打印到控制台?我使用error_log()但无法打印变量名称,而使用dd()却得到错误提示,无法将变量转换为字符串.

How to print data to the console? I use error_log() but I can't print variable names and with dd()I get and error saying that the variable couldn't be converted to string.

推荐答案

曾经尝试过这样的配置吗? 使用client_id和"client_secret"代替client_password. 您在param中的数据与您在打印"oauth_clients表"上发布的数据相同,对,但是我认为您的问题是此param"client_password",我以前从未见过这种方式!

Have ever tried configurations like this:? client_id and "client_secret" instead client_password. Your data in param it's the same one that you posted on print "oauth_clients table", right, but I think so your problem is this param "client_password", I never ever seen before this way!

这篇关于Laravel Passport基本api身份验证返回“错误":"invalid_client",“消息":“客户端身份验证失败";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆