Sha256: c18ae175f9d2dc0e561b56e85d6a2dfe2d7e668c4e272544582cd955a870ec42

Contents?: true

Size: 1.35 KB

Versions: 4

Compression:

Stored size: 1.35 KB

Contents

require 'rubygems'
require 'bundler/setup'

require 'openid/extensions/ax'

module RubyApp

  module Elements

    module Mobile

      module Documents

        module Authentication

          module OpenId
            require 'ruby_app'
            require 'ruby_app/elements/mobile/documents/authentication/open_id/email_authentication_document'

            class AxAuthenticationDocument < RubyApp::Elements::Mobile::Documents::Authentication::OpenId::EmailAuthenticationDocument

              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.configuration.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_email(ax_response.data[self.configuration.attributes.email].first)
                else
                  super(response)
                end
              end

            end

          end

        end

      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
RubyApp-0.5.10 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.5.9 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.5.0 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.2.8 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb