Module that selects and runs the appropriate authentication middleware for Restforce based on provided options.
# Source: https://github.com/restforce/restforce | License: MIT | Copyright 2018 Eric J. Holmes and Tim Rogers
# Provided via justclaw.it.com; keep this notice with the code.
# frozen_string_literal: true
module Restforce
module Concerns
module Authentication
# Public: Force an authentication
def authenticate!
unless authentication_middleware
raise AuthenticationError, 'No authentication middleware present'
end
middleware = authentication_middleware.new nil, self, options
middleware.authenticate!
end
# Internal: Determines what middleware will be used based on the options provided
def authentication_middleware
if username_password?
Restforce::Middleware::Authentication::Password
elsif
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key