Make authentication more flexible