Class: StandardId::Oauth::TokenLifetimeResolver
- Inherits:
-
Object
- Object
- StandardId::Oauth::TokenLifetimeResolver
- Defined in:
- lib/standard_id/oauth/token_lifetime_resolver.rb
Constant Summary collapse
- DEFAULT_ACCESS_TOKEN_LIFETIME =
1.hour.to_i
- DEFAULT_REFRESH_TOKEN_LIFETIME =
30.days.to_i
Class Method Summary collapse
Class Method Details
.access_token_for(flow_key) ⇒ Object
8 9 10 11 |
# File 'lib/standard_id/oauth/token_lifetime_resolver.rb', line 8 def access_token_for(flow_key) configured = lookup_token_lifetime(flow_key) positive_seconds(configured, default_access_token_lifetime) end |
.refresh_token_lifetime ⇒ Object
13 14 15 |
# File 'lib/standard_id/oauth/token_lifetime_resolver.rb', line 13 def refresh_token_lifetime positive_seconds(oauth_config.refresh_token_lifetime, DEFAULT_REFRESH_TOKEN_LIFETIME) end |