Lightweight rails engine for authentication