@asyncio.coroutine<EOL><INDENT>def _authenticate_websocket(self, websocket, event_handler):<DEDENT>
log.debug('<STR_LIT>')<EOL>json_data = json.dumps({<EOL>"<STR_LIT>": <NUM_LIT:1>,<EOL>"<STR_LIT:action>": "<STR_LIT>",<EOL>"<STR_LIT:data>": {<EOL>"<STR_LIT>": self._token<EOL>}<EOL>}).encode('<STR_LIT:utf8>')<EOL>yield from websocket.send(json_data)<EOL>while True:<EOL><INDENT>message = yield from websocket.recv()<EOL>status = json.loads(message)<EOL>log.debug(status)<EOL>yield from event_handler(message)<EOL>if ('<STR_LIT:status>' in status and status['<STR_LIT:status>'] == '<STR_LIT:OK>') and('<STR_LIT>' in status and status['<STR_LIT>'] == <NUM_LIT:1>):<EOL><INDENT>log.info('<STR_LIT>')<EOL>return True<EOL><DEDENT>elif '<STR_LIT>' in status and status['<STR_LIT>'] == <NUM_LIT:1>:<EOL><INDENT>log.error('<STR_LIT>')<EOL><DEDENT><DEDENT>
Sends a authentication challenge over a websocket.
This is not needed when we just send the cookie we got on login
when connecting to the websocket.