Method: OAuth2::AccessToken#refresh!
- Defined in:
- lib/oauth2/access_token.rb
#refresh!(params = {}) ⇒ AccessToken
Note:
options should be carried over to the new AccessToken
Refreshes the current Access Token
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oauth2/access_token.rb', line 79 def refresh!(params={}) raise "A refresh_token is not available" unless refresh_token params.merge!(:client_id => @client.id, :client_secret => @client.secret, :grant_type => 'refresh_token', :refresh_token => refresh_token) new_token = @client.get_token(params) new_token. = new_token end |