Class: CASino::TwoFactorAuthenticatorOverviewProcessor

Inherits:
Processor
  • Object
show all
Includes:
ProcessorConcern::TicketGrantingTickets
Defined in:
app/processors/casino/two_factor_authenticator_overview_processor.rb

Overview

The TwoFactorAuthenticatorOverview processor lists registered two factor devices for the currently signed in user.

This feature is not described in the CAS specification so it’s completly optional to implement this on the web application side.

Instance Method Summary collapse

Methods included from ProcessorConcern::TicketGrantingTickets

#acquire_ticket_granting_ticket, #cleanup_expired_ticket_granting_tickets, #find_valid_ticket_granting_ticket, #load_or_initialize_user, #remove_ticket_granting_ticket

Methods included from ProcessorConcern::Browser

#browser_info, #same_browser?

Methods inherited from Processor

#initialize

Constructor Details

This class inherits a constructor from CASino::Processor

Instance Method Details

#process(cookies = nil, user_agent = nil) ⇒ Object

This method will call ‘#user_not_logged_in` or `#two_factor_authenticators_found(Enumerable)` on the listener.



11
12
13
14
15
16
17
18
19
# File 'app/processors/casino/two_factor_authenticator_overview_processor.rb', line 11

def process(cookies = nil, user_agent = nil)
  cookies ||= {}
  tgt = find_valid_ticket_granting_ticket(cookies[:tgt], user_agent)
  if tgt.nil?
    @listener.user_not_logged_in
  else
    @listener.two_factor_authenticators_found(tgt.user.two_factor_authenticators.where(active: true))
  end
end