Permalink
Browse files

Updated README

  • Loading branch information...
1 parent fd301e7 commit f848e8d8be94724ca9c2a6f6adf6f4aa47258a5c Javier Vazquez Rodriguez committed May 1, 2009
Showing with 13 additions and 13 deletions.
  1. +6 −7 README.rdoc
  2. +7 −6 app/models/user.rb
View
@@ -14,23 +14,22 @@ Live Example can be found here: http://openid-example.joontos.ch
== What does this example app contain?
1. OpenID User registration using Javascript OpenID-Selector.
-2. Automatically log users in upon successful OpenID registration, saving his OpenID identifier and (if possible) his email address.
+2. Automatically log users in upon successful OpenID registration, saving his OpenID identifier and (if returned) his email address.
3. A my account area where the user can view / delete his account.
4. Login/Logout functionality.
5. Automatically store information on the users and their session in the databases. Such as login count, IP address, when they logged in last, and when their last activity occurred.
6. Count how many users are logged in / out in your system.
== Status
-* Tested OpenID providers with working authentication that return the users's email address: Google
-* Tested OpenID providers with working authentication: Google: Yahoo, MyOpenID, Technorati
-* The following OpenID authentication providers don't seem to work at all: Flickr (replaced by Yahoo?)
+* Fetching email using sreg and ax works now
+* Flickr OpenID doesn't seem to work at all...
-== TODO
+== Todo
* Port Javascript OpenID-Selector to the Prototype JS library.
-* Implement Facebook login into this app (waiting for Authlogic Facebook module).
-* Use this application to build a Rails plugin.
+* Implement Facebook login into this app (waiting for Authlogic Facebook module :-)).
+* Use this application to build a Rails plugin...feel free to help me on this one!
== Misc.
View
@@ -3,30 +3,31 @@ class User < ActiveRecord::Base
c.validate_login_field = false
# optional, but if a user registers by openid, he should at least share his email-address with the app
c.validate_email_field = false
- # fetch the email either by sreg or ax
+ # fetch email by ax
c.required_fields = ["http://axschema.org/contact/email"]
- c.optional_fields = ["email","nickname"]
+ # fetch email by sreg
+ c.optional_fields = ["email"]
end
private
def map_openid_registration(registration)
if registration.empty?
- # No email returned
+ # no email returned
self.email_autoset = false
else
- # Email set by SREG?
+ # email by sreg
unless registration["email"].nil? && registration["email"].blank?
self.email = registration["email"]
self.email_autoset = true
else
- # Email set by AX
+ # email by ax
unless registration['http://axschema.org/contact/email'].nil? && registration['http://axschema.org/contact/email'].first.blank?
self.email = registration['http://axschema.org/contact/email'].first
self.email_autoset = true
else
- # registration-hash seems to contain information other than sreg- or ax-email
+ # registration-hash seems to contain information other than the email-address
self.email_autoset = false
end
end

0 comments on commit f848e8d

Please sign in to comment.