Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 674 Bytes

client-credentials.md

File metadata and controls

26 lines (19 loc) · 674 Bytes

Implementing an Authorization Server with the Client Credentials Grant

  1. 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
    ]
]
  1. Next add a couple of clients to the oauth_clients table.

  2. Finally set up a route to respond to the incoming access token requests.

Route::post('oauth/access_token', function() {
    return Response::json(Authorizer::issueAccessToken());
});

← Back to start