Sha256: ad4447c11588dc6474db2d1e5483c9aa419f9a608424e9dee5b24c03d0f306fc

Contents?: true

Size: 705 Bytes

Versions: 5

Compression:

Stored size: 705 Bytes

Contents

module OAuth2
  module Grant
    class RefreshToken < Base

      def grant_type
        'refresh_token'
      end

      # Retrieve an access token for a given refresh token
      #
      # @param [String] refresh_token     refresh token
      # @param [Hash]   params additional params
      # @param [Hash]   opts options
      def get_token(refresh_token, opts={})
        params  = opts[:params] || {}
        opts[:params] = params.merge!({
          :grant_type    => grant_type,
          :refresh_token => refresh_token 
        })
        opts[:authenticate] ||= :headers
        method = opts.delete(:method) || :post
        make_request(method, @token_path, opts)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
oauth2-client-1.1.3 lib/oauth2/grant/refresh_token.rb
oauth2-client-1.1.2 lib/oauth2/grant/refresh_token.rb
oauth2-client-1.1.1 lib/oauth2/grant/refresh_token.rb
oauth2-client-1.1.0 lib/oauth2/grant/refresh_token.rb
oauth2-client-1.0.0 lib/oauth2/grant/refresh_token.rb