laravel 护照 returns 未经身份验证
laravel passport returns unauthenticated
我正在创建一个使用 Passport 来管理身份验证的 api。我已经使用 the docs.
设置了 Passport
问题
我无法登录。我不断收到 JSON 回复说 unauthenticated
数据库
在我的数据库中我有以下数据:
用户
id name email password timestamps
1 admin admin@admin.com y$mUu5KZdQhJ6qeyCeXsr9De0J9e8rgClILbhsGmnPpStwr1rhaa2je 2016-12-09 09:47:39 2016-12-09 09:47:39`
`
oauth_clients
id, user_id, name, secret, redirect, personal_access_client, password_client, revoked, created_at, updated_at
1, , Leerplatform app Password Grant Client, f37igMCW3cj6Dv8n4OM8uhBO98Geoag4vgmgptq0, http://localhost, 0, 1, 0, 2016-12-09 10:06:30, 2016-12-09 10:06:30
HTTP 请求
我向 /oauth/token
提出以下请求
Request URL:http://localhost:8000/oauth/token
Request Method:POST
Status Code:401 Unauthorized
Remote Address:[::1]:8000
grant_type:password
client_id:1
client_secret:f37igMCW3cj6Dv8n4OM8uhBO98Geoag4vgmgptq0
username:admin@admin.com
password:admin
scope:*
我尝试过的事情
- 截断访问令牌和刷新令牌table
- 我这样做是因为它曾经可以工作并且突然停止工作
- 正在删除所有 Laravel 个会话
设置到期日期
Passport::tokensExpireIn(Carbon::now()->addDays(15));
Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
问题是我在 RouteServiceProvider
而不是 AuthServiceProvider
中映射了我的护照路线
我正在创建一个使用 Passport 来管理身份验证的 api。我已经使用 the docs.
设置了 Passport问题
我无法登录。我不断收到 JSON 回复说 unauthenticated
数据库
在我的数据库中我有以下数据:
用户
id name email password timestamps
1 admin admin@admin.com y$mUu5KZdQhJ6qeyCeXsr9De0J9e8rgClILbhsGmnPpStwr1rhaa2je 2016-12-09 09:47:39 2016-12-09 09:47:39`
`
oauth_clients
id, user_id, name, secret, redirect, personal_access_client, password_client, revoked, created_at, updated_at
1, , Leerplatform app Password Grant Client, f37igMCW3cj6Dv8n4OM8uhBO98Geoag4vgmgptq0, http://localhost, 0, 1, 0, 2016-12-09 10:06:30, 2016-12-09 10:06:30
HTTP 请求
我向 /oauth/token
Request URL:http://localhost:8000/oauth/token
Request Method:POST
Status Code:401 Unauthorized
Remote Address:[::1]:8000
grant_type:password
client_id:1
client_secret:f37igMCW3cj6Dv8n4OM8uhBO98Geoag4vgmgptq0
username:admin@admin.com
password:admin
scope:*
我尝试过的事情
- 截断访问令牌和刷新令牌table
- 我这样做是因为它曾经可以工作并且突然停止工作
- 正在删除所有 Laravel 个会话
设置到期日期
Passport::tokensExpireIn(Carbon::now()->addDays(15)); Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
问题是我在 RouteServiceProvider
而不是 AuthServiceProvider