Class: Fortifier::AuthenticationSteps

Inherits:
Object
  • Object
show all
Defined in:
app/models/fortifier/authentication_steps.rb

Constant Summary collapse

STEPS =
[
  "InitializeAuthAttempt",
  "CheckForBlockedUser",
  "CheckForBlockedIp",
  "CheckForWhitelistedIp",
        "CheckForUsExternalIp",
]
BATCH_SSO_STEPS =
[
  "InitializeBatchSsoAuthAttempt",
  "CheckForWhitelistedIp",
]
ON_DEMAND_SSO_STEPS =
[
          "InitializeOnDemandSsoAuthAttempt",
          "CheckForWhitelistedIp",
]

Class Method Summary collapse

Class Method Details

.stepper(params = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/models/fortifier/authentication_steps.rb', line 19

def self.stepper(params={})
    # TODO: (DK) dry up below code
    
    case params[:auth_type]
    when "standard_auth"
      STEPS.each do |step|
      	step_class = ("Fortifier::AuthSteps::" + step).constantize
      	next if step_class.respond_to?(:skip_step?) && step_class.skip_step?(params)
      	params = step_class.invoke(params)
      end
    when "batch_sso_auth"
      BATCH_SSO_STEPS.each do |step|
        step_class = ("Fortifier::AuthSteps::" + step).constantize
        next if step_class.respond_to?(:skip_step?) && step_class.skip_step?(params)
        params = step_class.invoke(params)
      end
    when "on_demand_sso_auth"
      ON_DEMAND_SSO_STEPS.each do |step|
        step_class = ("Fortifier::AuthSteps::" + step).constantize
        next if step_class.respond_to?(:skip_step?) && step_class.skip_step?(params)
        params = step_class.invoke(params)
      end
    end
	
	params
end