opa icon indicating copy to clipboard operation
opa copied to clipboard

Failed to login

Open stevenroose opened this issue 6 years ago • 6 comments

Running latest ejabberd.

Paste from the js console:

authenticated content.js:122:13
CONNECTED 2d6c65fc98d33324d429.js:1:16406
rosterCallback@https://opa.konuro.net/_nuxt/2d6c65fc98d33324d429.js:1:17712
sendIQ/s<@https://opa.konuro.net/_nuxt/24344caf2dcb8748671d.js:2:29020
run@https://opa.konuro.net/_nuxt/24344caf2dcb8748671d.js:2:24412
_dataRecv/<@https://opa.konuro.net/_nuxt/24344caf2dcb8748671d.js:2:32872
forEachChild@https://opa.konuro.net/_nuxt/24344caf2dcb8748671d.js:2:16103
_dataRecv@https://opa.konuro.net/_nuxt/24344caf2dcb8748671d.js:2:32705
_onMessage@https://opa.konuro.net/_nuxt/24344caf2dcb8748671d.js:2:56595
24344caf2dcb8748671d.js:2:21108
error: undefined https://opa.konuro.net/_nuxt/2d6c65fc98d33324d429.js:1 - TypeError: n is undefined 24344caf2dcb8748671d.js:2:21108
running content script content.js:65:13
invalid bearer token, token= null content.js:97:15
authenticated content.js:122:13

stevenroose avatar Jan 28 '19 15:01 stevenroose

Using websocket.

stevenroose avatar Jan 28 '19 15:01 stevenroose

Unfortunately, Ejabberd has not yet been thoroughly tested to ensure compatibility.

I will label this issue so it remains open until I have time to ensure compatibility with Ejabberd.

Collaboration is especially appreciated in those cases which involve ensuring compatibility with different XMPP servers. So, anyone reading this, feel invited to help with the development.

kevinfaveri avatar Feb 04 '19 16:02 kevinfaveri

Just tested Opa on latest version with this ejabberd Docker version: https://hub.docker.com/r/rroemhild/ejabberd/

It is working in both http-bind and websocket. This Docker container enables both http-bind and websocket by default, on the urls:

  • BOSH: https://yourdomain:5280/http-bind
  • And for Websocket: wss://yourdomain:5280/websocket

And it is working flawlessly with the latest version of Opa available at DockerHub on both connection endpoints...

So, it is probably your current setup (ejabberd) that might not be configured correctly... Some other things I can think of is:

  • That you might be using a websocket URL starting with 'http' or 'https' (if so, just switch to 'ws' or 'wss' and it should work).
  • Your Websocket module in your ejabberd is not properly enabled and configured?
  • Your Opa json config is not being copied to inside the container? (You can see the contents of Opa config file though Docker using a command like in your Docker machine): -- docker exec CONTAINER_NAME cat /app/static/config/app-config.json
  • Incorrect 'XMPP_SERVER_DOMAIN' in the 'app-config.json'? Must be the same XMPP_DOMAIN configured in "Virtual Hosts" of ejabberd web-admin UI.
  • Can you test if the same error occurs if using the HTTP-BIND (BOSH) endpoint?
  • Can you see the log of ejabberd if Opa is connecting?

For reference, here is my test Opa config file for WSS connection:

{
    "XMPP_SERVER_ADDRESS": "wss://myejabberd:5280/websocket",
    "XMPP_SERVER_DOMAIN": "chat",
    "APP_LOCALE": "en-us"
}

kevinfaveri avatar Apr 25 '19 18:04 kevinfaveri

@stevenroose Can you do the suggested tests at https://github.com/credija/opa/issues/39#issuecomment-486791912? If it is not possible to proceed with this Issue I will assume it as closed based on the tests that I did myself.

kevinfaveri avatar Jun 22 '19 18:06 kevinfaveri

Is there a way to just run Opa locally without docker? Ideally I'd just have a generated directory that I can upload to a static file server. That was I can also test it easier locally. Currently I can't easily deploy another Opa docker for testing, sorry.

stevenroose avatar Jul 01 '19 12:07 stevenroose

@stevenroose You can run Opa with NodeJS, from source. Basically just download the project Master branch or clone with git, and on Command Line inside the project folder run yarn build && yarn start Also don't forget to edit the app-config.json file as exposed on the ReadME.

https://github.com/credija/opa#nodejs-from-source https://github.com/credija/opa#configuration

kevinfaveri avatar Jul 01 '19 12:07 kevinfaveri