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.6.33 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.32 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.31 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.29 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.28 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.27 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.26 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.25 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.24 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.22 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.21 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.16 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.12 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.11 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.10 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.8 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.7 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.2 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.6.1 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb
RubyApp-0.5.95 lib/ruby_app/elements/mobile/documents/authentication/open_id/sreg_authentication_document.rb