Sha256: 8ae59e00e2c475d3113ebc8e38d5302de81e572920a984faa7b415b9eb32b7f0

Contents?: true

Size: 795 Bytes

Versions: 11

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

module OAuth2
  module Strategy
    # The Client Credentials Strategy
    #
    # @see http://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-15#section-4.4
    class ClientCredentials < 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 client.
      #
      # @param [Hash] params additional params
      # @param [Hash] opts options
      def get_token(params = {}, opts = {})
        params = params.merge('grant_type' => 'client_credentials')
        @client.get_token(params, opts.merge('refresh_token' => nil))
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
oauth2-1.4.11 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.4 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.10 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.3 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.2 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.1 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.0 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.0.rc3 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.0.rc2 lib/oauth2/strategy/client_credentials.rb
oauth2-2.0.0.rc1 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.9 lib/oauth2/strategy/client_credentials.rb