class Setsuzoku::Service::WebService::AuthStrategies::CustomAuthStrategy

The API Custom Authentication Interface definition. Any Plugin that implements this must implement all methods required for Custom auth.

Defines all necessary methods for the custom auth strategy.

Public Class Methods

credential_class() click to toggle source
# File lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb, line 22
def self.credential_class
  Setsuzoku::Service::WebService::Credentials::CustomAuthCredential
end
required_instance_methods() click to toggle source
# File lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb, line 18
def self.required_instance_methods
  []
end

Public Instance Methods

auth_headers() click to toggle source

Any custom auth headers required to perform authenticated requests.

@return [Hash] the auth headers.

# File lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb, line 33
def auth_headers
  self.credential.auth_headers
end
new_token!() click to toggle source

Construct the custom token_request_body and request a token.

@return [void]

# File lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb, line 44
def new_token!
  action = :new_token
  body = self.credential.auth_actions[action][:body]
  get_token!(body, action)
end
refresh_expired_token!() click to toggle source

Construct the custom token_request_body and request a token.

@return [void]

# File lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb, line 57
def refresh_expired_token!
  action = :refresh_token
  body = self.credential.auth_actions[action][:body]
  get_token!(body, :refresh_token)
end