LoginController and supporting infrastructure