julien-c/laravel-oauth2-server

Unable to use Client Credentials Grant Type

activatedgeek opened this issue · 2 comments

I already have the UserCredentials with RefreshToken grant type working but cannot get ClientCredentials working. Please help!
This is my setup.
For the OAuth2 server singleton:

App::singleton('oauth2', function() {
    $storage = new App\Utils\StoryXpress\OAuth2\Storage();
    $server = new OAuth2\Server($storage, array('always_issue_new_refresh_token' => true,'refresh_token_lifetime' => 604800));

    // add all supported grant_types
    $server->addGrantType(new OAuth2\GrantType\ClientCredentials($storage));
    $server->addGrantType(new OAuth2\GrantType\UserCredentials($storage));
    $server->addGrantType(new OAuth2\GrantType\RefreshToken($storage));

    return $server;
});

My storage classes have been correctly implemented, hence the working refresh token and password grant_type. I am using the exactly same process to handle the token request yet it throws a 500 Internal Server error. There is no trace of any logs in either Laravel 5 or the Apache Server that I am using.

Any help here?

I'm sending the request as POST /oauth/ with parameters as grant_type=client_credentials&client_id=clientid&client_secret=somesecret

It magically worked without changes.

Weird. I'll check it out. Thanks for the report!