Skip to content

Customizing Token Expiration

felipeelias edited this page Jul 15, 2012 · 9 revisions

Access Grant

By default, access grants expires in 10 minutes. You can change this setting in the configuration:

Doorkeeper.configure do
  authorization_code_expires_in 20.minutes
end

DO NOT set this option to nil. This token should always expire in a short time

Access Token

By default, all access tokens expires in 2 hours. You can change this in the configuration:

Doorkeeper.configure do
  access_token_expires_in 4.hours
end

If you set the option to nil the access token will never expire (not recommended)

Clone this wiki locally