Implements #558 (user authentication)