Class: RubyApp::Elements::Pages::Authentication::OpenID::SRegAuthenticationPage

Inherits:
EmailAuthenticationPage show all
Defined in:
lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb

Direct Known Subclasses

MyOpenIDAuthenticationPage

Instance Attribute Summary

Attributes inherited from Base::BasePage

#interval

Attributes inherited from RubyApp::Element

#attributes

Instance Method Summary collapse

Methods inherited from EmailAuthenticationPage

#create_identity_from_email

Methods inherited from RubyApp::Element

#element_id, get_element

Methods included from Mixins::ConfigureMixin

#configure

Methods included from Mixins::TranslateMixin

#localize, #translate

Methods included from Mixins::TemplateMixin

#exclude_parent_template, #exclude_parent_template?, #get_templates, #template_name, #template_path

Methods included from Mixins::RenderMixin

#clear_content_for, #content_for, #render, #rendered?

Constructor Details

#initialize(identifier) ⇒ SRegAuthenticationPage

Returns a new instance of SRegAuthenticationPage.



22
23
24
# File 'lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb', line 22

def initialize(identifier)
  super(identifier)
end

Instance Method Details

#create_identity_from_response(response) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb', line 32

def create_identity_from_response(response)
  sreg_response = ::OpenID::SReg::Response.from_success_response(response)
  unless sreg_response.empty?
    self.create_identity_from_email(sreg_response.data['email'])
  else
    super(response)
  end
end

#process_request(request) ⇒ Object



26
27
28
29
30
# File 'lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb', line 26

def process_request(request)
  sreg_request = ::OpenID::SReg::Request.new
  sreg_request.request_fields(['email'], true)
  request.add_extension(sreg_request)
end