Sha256: 9b5a2295f3017f152695d786cc70543c85d85afca5a95983202376aecb38bba7

Contents?: true

Size: 1.18 KB

Versions: 8

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

8 entries across 8 versions & 1 rubygems

Version Path
RubyApp-0.0.78 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.77 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.76 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.75 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.74 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.73 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.72 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
RubyApp-0.0.71 lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb