Question

I'm trying to make a web app in Sinatra, and I was wondering if there was a good solution for user sign-up with email verification, as well as authentication - perhaps as rack middleware? OpenID support would be nice to have too.

I suppose I can roll my own, but I didn't want to reinvent the wheel. If I have to do so, can anyone point me to the libraries I might want to use, maybe even example code? I'm also worried I might end up forgetting to implement something important with signup/authentication, since I've never done this before.

In case I need a homemade solution, I've found bcrypt-ruby for password encryption and Sinatra::Mailer or Pony for email. For signing on with OpenID support, there's hancock and hancock-client, though I'm not entirely clear on usage and I don't actually need single sign-on support. Maybe I should just use a ruby openid library? Do I need anything else?

This is a pretty muddled question, but I hope someone more experienced can point me in the right direction.

Was it helpful?

Solution

You might be interested in Authlogic. You'll need to implement the e-mail verification yourself, but it will provide you with a good foundation for supporting this.

Authlogic can be used in any ruby framework you want: Rails, Merb, Sinatra, Mack, your own framework, whatever. It’s not tied down to Rails. It does this by abstracting itself from these framework’s controllers by using a controller adapter. Thanks to Rack, there is a defined standard for controller structure, and that’s what Authlogic’s abstract adapter follows. So if your controller follows the rack standards, you don’t need to do anything.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top