bshaffer / oauth2-server-php-docs

documentation for the oauth2-server-php library
231 stars 148 forks source link

Increase lifetime of Authorize code time #79

Closed sajumani closed 8 years ago

sajumani commented 8 years ago

Hi,'

how do we configure, Authorize code life time for 1 month...

xastor commented 8 years ago

I don't think that's a sensible thing to do.. authorization codes are meant to be used right away. What's the usecase?

bshaffer commented 8 years ago

This is definitely too long of an expiration, but for others who come here with the same question, the way to do this is via the auth_code_lifetime config parameter:

$config = ['auth_code_lifetime' => 10]; // make the code expire after 10 seconds
$server = new OAuth2\Server($storage, $config);