Class: OmniAuth::Strategies::SAML_RSTR

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/saml-rstr.rb,
lib/omniauth/strategies/saml-rstr/auth_request.rb,
lib/omniauth/strategies/saml-rstr/xml_security.rb,
lib/omniauth/strategies/saml-rstr/auth_response.rb,
lib/omniauth/strategies/saml-rstr/validation_error.rb

Defined Under Namespace

Modules: XMLSecurity Classes: AuthRequest, AuthResponse, ValidationError

Instance Method Summary collapse

Instance Method Details

#callback_phaseObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/omniauth/strategies/saml-rstr.rb', line 21

def callback_phase

  begin
    response = OmniAuth::Strategies::SAML_RSTR::AuthResponse.new(request.params['wresult'])
    response.settings = options
    
    @name_id  = response.name_id
    @attributes = response.attributes

    return fail!(:invalid_ticket, OmniAuth::Error.new('Invalid SAML_RSTR Ticket')) if @name_id.nil? || @name_id.empty? || !response.valid?
    super
  rescue ArgumentError => e   
    fail!(:invalid_ticket, OmniAuth::Error.new('Invalid SAML_RSTR Response'))
  end
end

#request_phaseObject



15
16
17
18
19
# File 'lib/omniauth/strategies/saml-rstr.rb', line 15

def request_phase
  request = OmniAuth::Strategies::SAML_RSTR::AuthRequest.new
  req = request.create(options)
  redirect(req)
end