Sha256: 53f29fa0bd74499d87ac2dc88518bf7b80621a35e42ed598c483242c49e38932

Contents?: true

Size: 982 Bytes

Versions: 17

Compression:

Stored size: 982 Bytes

Contents

# frozen_string_literal: true

module OAuth2
  module Strategy
    # The Resource Owner Password Credentials Authorization Strategy
    #
    # @see http://datatracker.ietf.org/doc/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(params)
        @client.get_token(params, opts)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/oauth2-2.0.9/lib/oauth2/strategy/password.rb
oauth2-2.0.9 lib/oauth2/strategy/password.rb
oauth2-1.4.11 lib/oauth2/strategy/password.rb
oauth2-2.0.8 lib/oauth2/strategy/password.rb
oauth2-2.0.7 lib/oauth2/strategy/password.rb
oauth2-2.0.6 lib/oauth2/strategy/password.rb
oauth2-2.0.5 lib/oauth2/strategy/password.rb
oauth2-2.0.4 lib/oauth2/strategy/password.rb
oauth2-1.4.10 lib/oauth2/strategy/password.rb
oauth2-2.0.3 lib/oauth2/strategy/password.rb
oauth2-2.0.2 lib/oauth2/strategy/password.rb
oauth2-2.0.1 lib/oauth2/strategy/password.rb
oauth2-2.0.0 lib/oauth2/strategy/password.rb
oauth2-2.0.0.rc3 lib/oauth2/strategy/password.rb
oauth2-2.0.0.rc2 lib/oauth2/strategy/password.rb
oauth2-2.0.0.rc1 lib/oauth2/strategy/password.rb
oauth2-1.4.9 lib/oauth2/strategy/password.rb