Sha256: 2003b62ac5277dcf730d138117768bdb248447b28c2f64fdd8eeee3b62edac6e

Contents?: true

Size: 1.18 KB

Versions: 13

Compression:

Stored size: 1.18 KB

Contents

require 'rubygems'
require 'bundler/setup'

require 'openid/extensions/sreg'

module RubyApp

  module Elements

    module Pages

      module Authentication

        module OpenId
          require 'ruby_app/elements/pages/authentication/open_id/email_authentication_page'
          require 'ruby_app/session'

          class SregAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenId::EmailAuthenticationPage

            template_path(:all, File.dirname(__FILE__))

            def initialize(identifier)
              super(identifier)
            end

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

            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

          end

        end

      end

    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
RubyApp-0.0.91 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.90 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.89 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.88 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.87 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.86 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.85 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.84 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.83 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.82 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.81 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.80 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.79 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb