def METHOD_NAME(self, port):  # todo: break this out into two functions: starting the server, and getting the URI
    pyfalog.debug("Starting server")
    # we need this to ensure that the previous get_request finishes, and then the socket will close
    if self.httpd:
        self.stopServer()
        time.sleep(1)
    self.httpd = StoppableHTTPServer(('localhost', port), AuthHandler)
    port = self.httpd.socket.getsockname()[1]
    self.serverThread = threading.Thread(target=self.httpd.serve, args=(self.handleServerLogin,))
    self.serverThread.name = "SsoCallbackServer"
    self.serverThread.daemon = True
    self.serverThread.start()
    return 'http://localhost:{}'.format(port)