Laravel 5.3 integrate dingo api and oauth2 Column not found: 1054 Unknown column "api_token" in the "where" section

I am using Laravel 5.3 to create an API and manage a server for a mobile application. I integrated the Dingo / api package and use Oauth2 for authentication. I made an API and logged in with the postman: API url: mydomain / api / auth / login Logged in as a result:

{"meta": {"message": "Success", "status_code": 1000, "status": true}, "data": {"access_token": "BK81coQ8mnR7PrfEuYzOwKBuZukXgeVw2pcUjHcZ", "token_type": "Bearer", "expires ": 604800," refresh_token ":" KRIB6YnvqT25rG1fGtoMrK9mGeB7m2J3cdj9QB8N "," profile ": {" id ": 1," user_id ": 1," name ":" ThanhDN "," postal_code ": null," null " phone_umber "age": null, "sex": null, "address": null, "avatar": null, "status": null, "creation_at": "2017-01-11 04:44:33", "updated_at ":" 2017-01-11 04:44:33 "," dele_at ": null}}}

I used access_token to call the API to get the user API info url: mydomain / api / user / 1 But I got an error:

{"message": "SQLSTATE [42S22]: column not found: 1054 Unknown column 'api_token' in 'where clause' (SQL: select * from userswhere api_token= 9mQmZqIjqnRamzX7syjtU6X1jGWrfQXndKKT97TU limit 1)," code: "" status_code status_code

I searched, but could not find any solution. Please help me solve this. Many thanks!!!

And even when you call the logout URL: mydomain / api / logout

+6
source share
2 answers

, ['guards']['api']['driver'] passport config/auth.php : php artisan config:cache.

+24

, ,

php artisan migrate:refresh

, ,

php artisan passport:install
0

Source: https://habr.com/ru/post/1666482/


All Articles