<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,6 +12,11 @@ module ActsAsAuthenticatedUser::ModelExtensions
           self.remember_me_duration = 30.days
         end
         
+        if supports_openid?
+          include OpenIdInstanceMethods
+          before_validation :normalize_identity_url
+        end
+        
         cattr_accessor :identifier_column
         self.identifier_column = options[:identifier] || :login
         
@@ -51,11 +56,16 @@ module ActsAsAuthenticatedUser::ModelExtensions
         column_names.include?('remember_token') &amp;&amp;
         column_names.include?('remember_token_expires_at') rescue false
     end
+    
+    def supports_openid?
+      @supports_openid ||= column_names.include?('identity_url') rescue false
+    end
   end
   
   module CoreInstanceMethods
   private
     def password_required?
+      return false if self.class.supports_openid? &amp;&amp; identity_url?
       hashed_password.blank? || !password.blank?
     end
     
@@ -87,4 +97,10 @@ module ActsAsAuthenticatedUser::ModelExtensions
       remember_token_expires_at.nil? || remember_token_expires_at &lt; Time.now
     end
   end
+  
+  module OpenIdInstanceMethods
+    def normalize_identity_url
+      self.identity_url = OpenIdAuthentication.normalize_url(identity_url) if identity_url?
+    end
+  end
 end</diff>
      <filename>lib/model_extensions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
-Object.send(:remove_const, :User)
 class User; end
 
 class TestController &lt; ActionController::Base</diff>
      <filename>spec/controller_extensions_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
+class User; end
+
 class AccountController &lt; ActionController::Base
   authenticated_user
   </diff>
      <filename>spec/controller_process_login_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,4 +24,11 @@ ActiveRecord::Schema.define(:version =&gt; 0) do
     t.column :remember_token, :string
     t.column :remember_token_expires_at, :datetime
   end
+  
+  create_table :open_id_users, :force =&gt; true do |t|
+    t.column :login, :string
+    t.column :hashed_password, :string
+    t.column :salt, :string
+    t.column :identity_url, :string
+  end 
 end</diff>
      <filename>spec/db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -176,6 +176,10 @@ describe &quot;A model which calls acts_as_authenticated_user with remember_token fie
     Time.freeze!
   end
   
+  it &quot;should support remember me&quot; do
+    MemorableUser.supports_remember_me?.should be_true
+  end
+  
   it &quot;should remember me for 30 days&quot; do
     @user.should_receive(:save).with(false)
     @user.remember_me!
@@ -215,3 +219,25 @@ describe &quot;A model which calls acts_as_authenticated_user with remember_token fie
     @user.remember_token_expires_at.should be_nil
   end
 end
+
+
+describe &quot;A model which calls acts_as_authenicated_user with an OpenID identity field&quot; do
+  class OpenIdUser &lt; ActiveRecord::Base
+    acts_as_authenticated_user
+  end
+  
+  it &quot;should support open id&quot; do
+    OpenIdUser.supports_openid?.should be_true
+  end
+  
+  it &quot;should not require a password if identity_url is provided&quot; do
+    @user = OpenIdUser.new(:login =&gt; 'test', :identity_url =&gt; 'my.identity.com')
+    @user.should be_valid
+  end
+  
+  it &quot;should normalize identity_url before validation&quot; do
+    @user = OpenIdUser.new(:login =&gt; 'test', :identity_url =&gt; 'my.identity.com')
+    @user.valid?
+    @user.identity_url.should == 'http://my.identity.com/'
+  end
+end</diff>
      <filename>spec/model_extensions_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,9 @@ databases = YAML::load(IO.read(plugin_spec_dir + &quot;/db/database.yml&quot;))
 ActiveRecord::Base.establish_connection(databases[ENV[&quot;DB&quot;] || &quot;sqlite3&quot;])
 load(File.join(plugin_spec_dir, &quot;db&quot;, &quot;schema.rb&quot;))
 
+Object.send(:remove_const, :User) if defined?(User)
+Object.send(:remove_const, :AccountController) if defined?(AccountController)
+
 Spec::Runner.configure do |config|
   [:get, :post, :put, :delete, :render].each do |action|
     eval %Q{</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6d4a4e7f8fad4fa87566cd8d1b3e7ba0656eb2b2</id>
    </parent>
  </parents>
  <author>
    <name>Sam Pohlenz</name>
    <email>sam@sampohlenz.com</email>
  </author>
  <url>http://github.com/spohlenz/acts_as_authenticated_user/commit/fd1f5376267c0f263bc85b3c812c3e8d59ca23ed</url>
  <id>fd1f5376267c0f263bc85b3c812c3e8d59ca23ed</id>
  <committed-date>2008-12-11T20:13:23-08:00</committed-date>
  <authored-date>2008-12-11T20:13:23-08:00</authored-date>
  <message>Model support for OpenId</message>
  <tree>12344115951e8de373a9ea0e19aa4fcfc5c2963b</tree>
  <committer>
    <name>Sam Pohlenz</name>
    <email>sam@sampohlenz.com</email>
  </committer>
</commit>
