Sha256: 37f922c6cede04b419251a7bc3280d8c48d7aa715fe1aa1f1e5595138a3bc68e

Contents?: true

Size: 754 Bytes

Versions: 11

Compression:

Stored size: 754 Bytes

Contents

module OAuth2
  module Strategy
    # The Client Credentials Strategy
    #
    # @see http://tools.ietf.org/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.8 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.7 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.6 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.5 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.4 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.3 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.2 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.1 lib/oauth2/strategy/client_credentials.rb
oauth2-1.4.0 lib/oauth2/strategy/client_credentials.rb
oauth2-1.3.1 lib/oauth2/strategy/client_credentials.rb
oauth2-1.3.0 lib/oauth2/strategy/client_credentials.rb