Sha256: f1290ec99b482e4ea1f397eef3a6452cb5dfbf191ffcece70dcd3e734f3b5d19

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

require 'rubygems'
require 'bundler/setup'

require 'openid/extensions/ax'

module RubyApp

  module Elements

    module Pages

      module Authentication

        module OpenID
          require 'ruby_app/elements/pages/authentication/open_id/authentication_page'
          require 'ruby_app/session'

          class AXAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::AuthenticationPage

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

            def initialize(identifier)
              super(identifier)
            end

            def process_request(request)
              ax_request = ::OpenID::AX::FetchRequest.new
              ax_request.add(::OpenID::AX::AttrInfo.new(self.configure.attributes.email, 'Email', true))
              request.add_extension(ax_request)
            end

            def create_identity_from_response(response)
              ax_response = ::OpenID::AX::FetchResponse.from_success_response(response)
              if ax_response
                self.create_identity_from_url(response.identity_url,
                                              :email => ax_response.data[self.configure.attributes.email].first)
              else
                super(response)
              end
            end

          end

        end

      end

    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
RubyApp-0.0.14 lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
RubyApp-0.0.13 lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
RubyApp-0.0.12 lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
RubyApp-0.0.11 lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
RubyApp-0.0.10 lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
RubyApp-0.0.9 lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb