Permalink
Browse files

added documentation on how to not require a login when using openid

  • Loading branch information...
1 parent 7aa9719 commit 1134b755b5875f1c7b6914b9df6fca115516a735 @mreinsch mreinsch committed Mar 18, 2010
Showing with 19 additions and 0 deletions.
  1. +19 −0 README.rdoc
View
19 README.rdoc
@@ -73,6 +73,25 @@ You should save your @user objects this way as well, because you also want the u
Notice we are saving with a block. Why? Because we need to redirect the user to their OpenID provider so that they can authenticate. When we do this, we don't want to execute that block of code, because if we do, we will get a DoubleRender error. This lets us skip that entire block and send the user along their way without any problems.
+=== 5. Check your validations / Auto registration
+
+In case you want to enable automatic user registrations with OpenID, enable this in your session:
+
+ class UserSession < Authlogic::Session::Base
+ auto_register
+ end
+
+In this case you migth also want to change the user object to no longer require a login:
+
+ class User < ActiveRecord::Base
+ acts_as_authentic do |c|
+ c.merge_validates_length_of_login_field_options(:unless => :using_openid?)
+ c.merge_validates_format_of_login_field_options(:unless => :using_openid?)
+ end
+ end
+
+=== 6. Done!
+
That's it! The rest is taken care of for you.
== Redirecting from the models?

0 comments on commit 1134b75

Please sign in to comment.