I am using Oauth-server-laravel Authentication.
What i have done so far:
When I send the wrong one access_tokento the API that I created in laravel, it gives the following answer,
{
"error": "access_denied",
"error_description": "The resource owner or authorization server denied the request."
}
I used oauthas middleware in the following order,
Route::group(['namespace' => 'Modules\User\Http\Controllers', 'middleware' => 'oauth'], function () {
Route::post('getUserProfileDetail', 'UserController@getUserProfileDetail');
});
Problem:
If the credentials are incorrect, then oauth will automatically respond with a default message, and I want to configure these response messages,
I have half the success in the fact that if the credentials are correct, then it calls the function specified in the route, and that I add the mre response that I want to send.
$response = $this->authorizer->issueAccessToken();
$code = 200;
$response['result'] = 'success';
$response['user_id'] = $user['id'];
$response['email'] = $user['email'];
$response['name'] = $user['name'];
, , .