flexible authentication solution for Rails based application