Devise, Authlogic, & Restful Authorization

This is not a question but a mini-report to others who might be in my
boat.

My application needed/needs the ability to authenticate a login via
email.

There are Restful Authorization examples that claim to do this … but I
have not been able to successfully get it to work. I can get the email
send out and the email responded to, but the sample code I trided to
implement do not then “authorize” the user.

I also tried Authlogic. If there are hooks in there with the state
machine such that an email could be sent out, I could not find it.

Finally I tried something call Devise … which sits on top of Warden.
Sample Devise code (with a bit of smtp massaging) pretty much worked
right out of the box. That sample can be found at
http://github.com/plataformatec/devise_example

Note that the example uses a user’s email as a login id. Adding a login
id and “hiding” the email when the user logs in is left as an exercise
to the reader. I went through that exercise and it made me a bit
familiar with the Devise internals. Some of the error messages are in
the code … others are in yml files.

It takes some doing to get it all installed. Nonetheless, I recommend
Devise.

Caution: I’m a newbie to RoR so take my recommendation with a brick of
salt.

Ralph S. wrote:

This is not a question but a mini-report to others who might be in my
boat.

I apologize to everyone for my spelling and grammar errors. I usually
do a better job of proofreading.

Damn, I’ve been up too many hours.

Ralph S. wrote:

This is not a question but a mini-report to others who might be in my
boat.

My application needed/needs the ability to authenticate a login via
email.

There are Restful Authorization examples that claim to do this … but I
have not been able to successfully get it to work. I can get the email
send out and the email responded to, but the sample code I trided to
implement do not then “authorize” the user.

I also tried Authlogic. If there are hooks in there with the state
machine such that an email could be sent out, I could not find it.

You can do this with Authlogic, and I don’t believe
acts_as_state_machine is necessary. See of the rdoc for the various
Authlogic ::Config modules has anything useful. Or you might need to
use perishable_token.

Finally I tried something call Devise … which sits on top of Warden.
Sample Devise code (with a bit of smtp massaging) pretty much worked
right out of the box. That sample can be found at
http://github.com/plataformatec/devise_example

Note that the example uses a user’s email as a login id. Adding a login
id and “hiding” the email when the user logs in is left as an exercise
to the reader. I went through that exercise and it made me a bit
familiar with the Devise internals. Some of the error messages are in
the code … others are in yml files.

It takes some doing to get it all installed. Nonetheless, I recommend
Devise.

Caution: I’m a newbie to RoR so take my recommendation with a brick of
salt.

Then why are you even making it?

Seriously, don’t give up on Authlogic. It’s what most people are using
these days. Check out Railscast #160 if you need an overview.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]