Authentication gem extracted from Rails Tutorial