Class: Crema::OAuth
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.token ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/crema/oauth.rb', line 3 def self.token response = connection.post( '/oauth/token', grant_type: 'client_credentials'.freeze, client_id: Crema.config.app_id, client_secret: Crema.config.secret ) return nil unless response.success? JSON.parse(response.body).dig('access_token') end |