Sha256: 30bcedee7d1125c1929b6da7ad97e4b399d902ebf5c12cfe787b2c11ef548147

Contents?: true

Size: 1.3 KB

Versions: 48

Compression:

Stored size: 1.3 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?
                  return self.create_identity_from_email(sreg_response.data['email'])
                else
                  return super(response)
                end
              end

            end

          end

        end

      end

    end

  end

end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
RubyApp-0.7.16 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.15 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.14 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.13 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.12 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.11 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.10 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.9 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.5 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.4 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.3 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.2 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.1 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.7.0 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.6.71 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.6.70 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.6.69 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.6.68 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.6.67 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb
RubyApp-0.6.66 lib/ruby_app/elements/mobile/documents/authentication/open_id/s_reg_authentication_document.rb