I've got a little further with this, and I redirect to the URL in the response's params.loginUri.
The URL looks something like this:
However, the 'app/' shouldn't be in there (it results in a 404)... the 'correct' URL should be:
Is there any way that this can be configured? The web socket endpoint URI is wss://server/app/ btw.