Class: Google::Authorization
- Defined in:
- lib/gcal_unit/authorization.rb
Overview
Public: API methods to authorize a specific user for the API calls.
Instance Method Summary collapse
-
#refresh ⇒ Object
Public: Returns a new access token for a specific refresh token.
Methods inherited from Client
#http_delete, #http_get, #http_post, #http_put, #initialize
Constructor Details
This class inherits a constructor from Google::Client
Instance Method Details
#refresh ⇒ Object
Public: Returns a new access token for a specific refresh token.
Returns a hash of metadata for refreshed user access.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gcal_unit/authorization.rb', line 10 def refresh = { :body => { :client_id => Google.configuration.client_id, :client_secret => Google.configuration.client_secret, :refresh_token => @token, :grant_type => 'refresh_token' }, :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' } } http_post "/o/oauth2/token", end |