(self, port)
| 178 | self.httpd = None |
| 179 | |
| 180 | def startServer(self, port): # todo: break this out into two functions: starting the server, and getting the URI |
| 181 | pyfalog.debug("Starting server") |
| 182 | |
| 183 | # we need this to ensure that the previous get_request finishes, and then the socket will close |
| 184 | if self.httpd: |
| 185 | self.stopServer() |
| 186 | time.sleep(1) |
| 187 | |
| 188 | self.httpd = StoppableHTTPServer(('localhost', port), AuthHandler) |
| 189 | port = self.httpd.socket.getsockname()[1] |
| 190 | self.serverThread = threading.Thread(target=self.httpd.serve, args=(self.handleServerRequest,)) |
| 191 | self.serverThread.name = "SsoCallbackServer" |
| 192 | self.serverThread.daemon = True |
| 193 | self.serverThread.start() |
| 194 | |
| 195 | return 'http://localhost:{}'.format(port) |
| 196 | |
| 197 | def handleLogin(self, code): |
| 198 | auth_response, data = self.auth(code) |
no test coverage detected