Sha256: 09fd6e05c2231f23f76324dab75a033b1701d51a4bbd33e0b47f873293107699

Contents?: true

Size: 1.29 KB

Versions: 97

Compression:

Stored size: 1.29 KB

Contents

require 'rubygems'
require 'bundler/setup'

require 'openid/extensions/sreg'

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 SregAuthenticationDocument < RubyApp::Elements::Mobile::Documents::Authentication::OpenId::EmailAuthenticationDocument

              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

end

Version data entries

97 entries across 97 versions & 1 rubygems

Version Path
RubyApp-0.5.51 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.50 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.49 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.48 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.47 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.46 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.45 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.44 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.43 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.42 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.41 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.40 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.39 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.38 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.37 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.36 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.35 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.34 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.33 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.32 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb