NoamB/sorcery - GitHub

“Sorcery is a stripped-down, bare-bones authentication library, with which you can write your ownauthentication flow”. Examples for Rails 3 and Sinatra.