Specify different access_lifetime depending on grant type
is it possible to change access_lifetime for client_credential grant type only?
i've tried a lot of combination, like setting the config array for addGrantType, but it still use the main value (default 3600).
inserting this snippet in request process solve the problem
$request = OAuth2\Request::createFromGlobals();
if (isset($request->request['grant_type']) && $request->request['grant_type'] == "client_credentials")
$server->setConfig('access_lifetime', 3600*24);
good recommendation - I like this solution.
The only other solution I can think of would involve subclassing both OAuth2\GrantType\ClientCredentials and OAuth2\ResponseType\AccessToken. We could add a $config['access_lifetime'] parameter to each GrantType which defaults to null, and if set would override the access_lifetime parameter. I'm not crazy about this solution, but if this feature is something people want, I will consider it.