Skip to content

Customizing Token Expiration

Greg Leppert edited this page Jan 9, 2015 · 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)

Refresh Token

Unlike access grants and access tokens, refresh tokens do not have a TTL expiration.

Clone this wiki locally