Sha256: 5bf08464b76cb1b55280b3513d1b6275ac97938e0940532b32ff97e46c87fca1

Contents?: true

Size: 1.52 KB

Versions: 8

Compression:

Stored size: 1.52 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(RubyApp::Elements::Mobile::Documents::Authentication::OpenId::AxAuthenticationDocument.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
                  return self.create_identity_from_email(ax_response.data[RubyApp::Elements::Mobile::Documents::Authentication::OpenId::AxAuthenticationDocument.configuration.attributes.email].first)
                else
                  return super(response)
                end
              end

            end

          end

        end

      end

    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
RubyApp-0.6.42 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.41 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.40 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.39 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.38 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.36 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.35 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb
RubyApp-0.6.34 lib/ruby_app/elements/mobile/documents/authentication/open_id/ax_authentication_document.rb