1

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.

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".

Postman data Postman data

oauth_clients table Database data


What I have tried

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

Possible cause

  • 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.

  • 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) composer.json


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.

ibitebyt3s
  • 2,992
  • 2
  • 15
  • 25

2 Answers2

3

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!

  • 1
    Problem solved!!! I can deduce that maybe the 'client_password' field was substituted by 'client_secret' in the latest versions. Thank you... – ibitebyt3s Dec 22 '17 at 03:59
0
  1. you have to wrong pass client_id and client_password
  2. if you have to right pass client_id and client_password then check in the database table oauth_clients client_id and client_password is row inserted or not if not added then run this command in console

php artisan passport:client

this will register client_id and client_password and then check that in this table(oauth_clients) if not added then maunally added client_id and client_passsword

Jignesh Joisar
  • 13,720
  • 5
  • 57
  • 57
  • Your answer is not understandable and illogical. Why would I have to pass wrong data? The picture of the database table is of the oauth_clients table. Finally, use proper punctuation marks and correct verb tenses. – ibitebyt3s Dec 11 '17 at 03:22
  • your error say { "error":"invalid_client","message":"Client authentication failed"} which you have client_id and client_password send(pass) this is wrong or not exists in the database...... so you have to send(pass) right client_id and client_password .... your user detail is right ... (my english is so weak ) – Jignesh Joisar Dec 11 '17 at 07:55