it always return invalid_client
MohameedElsaeid opened this issue · 3 comments
Request Method : POST
Url : v1/oauth/token
Request Body
{ "grant_type":"password", "client_id":1, "client_secret":"mRPVkQlA3tgHPC2IWA8334ozF52QaIdII4YMGz3D", "password":"123456", "scope":"" }
Response :
{ "error": "invalid_client", "error_description": "Client authentication failed", "message": "Client authentication failed" }
User Model
`class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, HasApiTokens;
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id',
'user_name',
'user_email',
'user_password',
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'user_password',
];
}
`
Request Method : POST
Url : v1/oauth/token
Request Body
{ "grant_type":"password", "client_id":1, "client_secret":"mRPVkQlA3tgHPC2IWA8334ozF52QaIdII4YMGz3D", "password":"123456", "scope":"" }
Response :
{ "error": "invalid_client", "error_description": "Client authentication failed", "message": "Client authentication failed" }
User Model
`class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, HasApiTokens;protected $table = 'users'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'user_id', 'user_name', 'user_email', 'user_password', ]; /** * The attributes excluded from the model's JSON form. * * @var array */ protected $hidden = [ 'user_password', ];
}
`
I have the same problem here. Always return invalid_client. I'm stuck here for days. Can anyone please help us to solved this problem?
up, having the same error,
I could solve this problem by runing:
- php artisan passport:client --password
and using this client for password verifications