Sha256: a22e73a6e350938cf3c1881e3f9cf2c048c77590e4b38742e0872dbc8d3d1d1a

Contents?: true

Size: 961 Bytes

Versions: 13

Compression:

Stored size: 961 Bytes

Contents

module OAuth2
  module Strategy
    # The Resource Owner Password Credentials Authorization Strategy
    #
    # @see http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.3
    class Password < Base
      # Not used for this strategy
      #
      # @raise [NotImplementedError]
      def authorize_url
        raise NotImplementedError, "The authorization endpoint is not used in this strategy"
      end

      # Retrieve an access token given the specified End User username and password.
      #
      # @param [String] username the End User username
      # @param [String] password the End User password
      # @param [Hash] params additional params
      def get_token(username, password, params={}, opts={})
        params = {'grant_type' => 'password',
                  'username'   => username,
                  'password'   => password}.merge(client_params).merge(params)
        @client.get_token(params, opts)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
oauth2-0.9.2 lib/oauth2/strategy/password.rb
dreamwords-oauth2-0.8.1 lib/oauth2/strategy/password.rb
vagrant-actionio-0.0.9 vendor/bundle/gems/oauth2-0.9.1/lib/oauth2/strategy/password.rb
oauth2-0.9.1 lib/oauth2/strategy/password.rb
oauth2-0.8.1 lib/oauth2/strategy/password.rb
oauth2-0.9.0 lib/oauth2/strategy/password.rb
oauth2-0.8.0 lib/oauth2/strategy/password.rb
oauth2-0.7.1 lib/oauth2/strategy/password.rb
oauth2-0.7.0 lib/oauth2/strategy/password.rb
oauth2-0.6.1 lib/oauth2/strategy/password.rb
oauth2-0.6.0 lib/oauth2/strategy/password.rb
oauth2-0.5.2 lib/oauth2/strategy/password.rb
oauth2-0.5.1 lib/oauth2/strategy/password.rb