Sha256: 24df16fd0db0a7cafe2899aff78d525d815f66d2c2b04bb854cc8e14ed4bfd20

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

module OAuth2Client
  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

1 entries across 1 versions & 1 rubygems

Version Path
oauth2-client-2.0.0 lib/oauth2-client/grant/refresh_token.rb