Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

delete the format parameter so that openid works on the iphone. add s…

…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...
commit da282f1dac9219d0bb8167d0a0baf6e5acf2af90 1 parent 23a2636
authored April 02, 2008
20  init.rb
... ...
@@ -1,11 +1,17 @@
1  
-begin
2  
-  require 'openid'
3  
-rescue LoadError
  1
+if config.respond_to?(:gems)
  2
+  config.gem 'ruby-openid', :lib => 'openid', :version => '>=2.0.4'
  3
+else
4 4
   begin
5  
-    gem 'ruby-openid', '>=2.0.4'
6  
-  rescue Gem::LoadError
7  
-    puts "Install the ruby-openid gem to enable OpenID support"
  5
+    require 'openid'
  6
+  rescue LoadError
  7
+    begin
  8
+      gem 'ruby-openid', '>=2.0.4'
  9
+    rescue Gem::LoadError
  10
+      puts "Install the ruby-openid gem to enable OpenID support"
  11
+    end
8 12
   end
9 13
 end
10 14
 
11  
-ActionController::Base.send :include, OpenIdAuthentication
  15
+config.to_prepare do
  16
+  ActionController::Base.send :include, OpenIdAuthentication
  17
+end
1  lib/open_id_authentication.rb
@@ -101,6 +101,7 @@ def begin_open_id_authentication(identity_url, fields = {})
101 101
 
102 102
     def complete_open_id_authentication
103 103
       params_with_path = params.reject { |key, value| request.path_parameters[key] }
  104
+      params_with_path.delete(:format)
104 105
       open_id_response = timeout_protection_from_identity_server { open_id_consumer.complete(params_with_path, requested_url) }
105 106
       identity_url     = normalize_url(open_id_response.endpoint.claimed_id) if open_id_response.endpoint.claimed_id
106 107
 

0 notes on commit da282f1

Please sign in to comment.
Something went wrong with that request. Please try again.