Sha256: e7916b980e06bc5ebfb34fdfd11f408cebbd7969c88de2cf37495eaeb7e60c98

Contents?: true

Size: 1.18 KB

Versions: 43

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

43 entries across 43 versions & 1 rubygems

Version Path
RubyApp-0.0.70 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.69 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.68 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.64 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.63 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.62 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.61 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.60 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.59 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.58 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.57 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.56 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.55 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.54 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.53 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.52 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.51 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.50 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.49 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.48 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb