- To enable this grant add the following to the
config/oauth2.php
configuration file:
'grant_types' => [
'client_credentials' => [
'class' => '\League\OAuth2\Server\Grant\ClientCredentialsGrant',
'access_token_ttl' => 3600
]
]
-
Next add a couple of
clients
to theoauth_clients
table. -
Finally set up a route to respond to the incoming access token requests.
Route::post('oauth/access_token', function() {
return Response::json(Authorizer::issueAccessToken());
});