I spent yesterday coding a very abbreviated version of an authentication service that uses Sinatra, Mongoid and RSpec 2. It took more than a couple hours because there are so many outdated code samples on the web that just don’t work. I put my code up on github for people to see. Just clone the repository and run:
While the current example is very basic, I will update it with enhancements and talk more about how to write a good authentication service. For this example I quickly rolled my own basic authentication since the main purpose is to get you up and running quickly with Sinatra, Mongoid, and RSpec2 . I may end up using Authlogic, Devise, or improving on my own authentication functionality.
Get the code here.
Feel free to contribute to the example. Keep in mind this is a service to be consumed by front end apps, not a full application. Also I won’t accept contributions without tests.
If you enjoyed this post, make sure you subscribe to my RSS feed!