I just finished a RPXNow Rails plugin and gem
so that everyone can enjoy the great usability + simplicity of RPX
Use OpenId / Google / Yahoo / MySpace / Facebook connect transparently through the same interface.
Usage
#login.erb
RPXNow.embed_code('mywebsite',url_for(:controller=>:session, :action=>:rpx_token))
#sessions_controller.rb
def rpx_token
data = RPXNow.user_data(params[:token],'YOUR RPX API KEY')
self.current_user = User.find_by_identifier(data[:identifier]) || User.create!(data)
redirect_to '/'
end
Doing the same with OpenId is impossible, since every provider has his own standards of which fields to supply and how to name them.
Happy login!

17 comments
Comments feed for this article
February 1, 2009 at 4:22
Christopher A. Wheeler
Do you have any tips on how to get RPX to work with a WordPress blog?
February 1, 2009 at 8:18
pragmatig
would be interesting to use rpx as plugin for wordpress, but i have not seen such a thing…
aybe a good start woulkd be to simply port the RPXNow library to php, and start with this.
April 13, 2009 at 14:37
pragmatig
the wordpress plugin can be found here http://wordpress.org/extend/plugins/rpx/
April 14, 2009 at 21:15
Julian Burgess
Typo on this line, should read RPXNow
data = RPXNew.user_data(params[:token],’YOUR RPX API KEY’)
April 15, 2009 at 4:58
pragmatig
opps, thanks
June 4, 2009 at 19:56
Nick
Thanks for this great plugin. I’m getting an, undefined method `find_by_identifier’. Where is this method defined or have I missed something?
June 5, 2009 at 6:45
pragmatig
you need an identifier(string) column on your model -> find_by_identifier works, I just added an example migration to make that easier
(identifier is used to store the unique identifier every provider assigns to its users)
June 5, 2009 at 7:44
Nick
Hi, thanks very much. Turns out i’d spelt identifier wrong in my migration. Doh!
June 5, 2009 at 7:56
pragmatig
I also misspelled it several times
August 29, 2009 at 14:27
IkeBarnes
Will this work with rails 2.1?
August 29, 2009 at 15:43
pragmatig
It works with anything, sinatra/waves/merb/rails 1.2.6 / 2.1 / 2.3.3, is basically only a gem also available as rails plugin, so there should be no problems.
October 6, 2009 at 9:56
kausik bankura
i getting the error from RPX->data not found,as i am implementing is asp.net.
Can anybody help me,URGENT!!!!!!!!!
October 6, 2009 at 12:31
pragmatig
data not found == identifier was wrong / already has been used, make sure to pass the correct identifier, and to not pass it e.g. twice
November 9, 2009 at 1:13
Pratik
Hi Michael,
Thanks for the great information.
I have a very newbie question:
RPXNow.embed_code(‘mywebsite’,rpx_token_sessions_url)
what is “rpx_token_sessions_url” how do i construct it?
I have registered an application called mosaicit at RPX website.
and am trying to connect from localhost then how should my url look like ?
Thanks,
Pratik
November 9, 2009 at 6:55
pragmatig
I just updated this part, hope its clearer now
November 14, 2009 at 21:14
jabberbuzz
i get the same error: rpx -> data not found (Error code 2 ) , could you elaborate a bit more
Thanks
November 14, 2009 at 21:39
pragmatig
I only got this error when logging in twice with the same identifier, e.g. using refresh page, or when the identifier was wrong or when the identifier was very old