Skip to content

Commit

Permalink
delete the format parameter so that openid works on the iphone. add s…
Browse files Browse the repository at this point in the history
…upport for config.gem on rails 2.1+

git-svn-id: http://svn.rubyonrails.org/rails/plugins/open_id_authentication@9207 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
rick committed Apr 2, 2008
1 parent 23a2636 commit da282f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions init.rb
@@ -1,11 +1,17 @@
begin
require 'openid'
rescue LoadError
if config.respond_to?(:gems)
config.gem 'ruby-openid', :lib => 'openid', :version => '>=2.0.4'
else
begin
gem 'ruby-openid', '>=2.0.4'
rescue Gem::LoadError
puts "Install the ruby-openid gem to enable OpenID support"
require 'openid'
rescue LoadError
begin
gem 'ruby-openid', '>=2.0.4'
rescue Gem::LoadError
puts "Install the ruby-openid gem to enable OpenID support"
end
end
end

ActionController::Base.send :include, OpenIdAuthentication
config.to_prepare do
ActionController::Base.send :include, OpenIdAuthentication
end
1 change: 1 addition & 0 deletions lib/open_id_authentication.rb
Expand Up @@ -101,6 +101,7 @@ def begin_open_id_authentication(identity_url, fields = {})

def complete_open_id_authentication
params_with_path = params.reject { |key, value| request.path_parameters[key] }
params_with_path.delete(:format)
open_id_response = timeout_protection_from_identity_server { open_id_consumer.complete(params_with_path, requested_url) }
identity_url = normalize_url(open_id_response.endpoint.claimed_id) if open_id_response.endpoint.claimed_id

Expand Down

0 comments on commit da282f1

Please sign in to comment.