SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
805 stars 171 forks source link

firecamp always gives me ws connection error while testing my change streams #369

Closed shireefadel closed 4 years ago

shireefadel commented 4 years ago

I did all the security configuration and created a filtered change stream on my collectionm then tried to test it using firecamp using the following uri

ws://username:****@mydomain:8080/collection/_streams/changestream?avars={'n': 'Device 1'}

but it always fail connecting

here is the log

11:40:23.570 [XNIO-2 I/O-4] ^[[39mDEBUG^[[0;39m o.r.s.h.ResponseInterceptorsStreamSinkConduit - Executing response interceptor TokenCORSResponseInterceptor for /collection/_streams/changestream
11:40:23.571 [XNIO-2 I/O-4] ^[[34mINFO ^[[0;39m o.r.security.handlers.RequestLogger - GET http://domain:8080/collection/_streams/changestream?avars={'n': Device 1} from /89.211.175.90:53750 => status=^[[31;1m400^[[m elapsed=15ms contentLength=176 username=user roles=[admin]
11:40:33.188 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - tokenBasicAuthMechanism -> NOT_ATTEMPTED
11:40:33.188 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - basicAuthMechanism -> NOT_ATTEMPTED
11:40:33.188 [XNIO-2 task-1] ^[[34mINFO ^[[0;39m o.r.security.handlers.RequestLogger - GET http://domain:8080/collection/_streams/changestream?avars={'n': 'Device 1'} from /89.211.175.90:53774 => status=^[[31;1m401^[[m elapsed=1ms contentLength=0
11:40:33.597 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - tokenBasicAuthMechanism -> NOT_ATTEMPTED
11:40:33.598 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - basicAuthMechanism -> AUTHENTICATED
11:40:33.604 [XNIO-2 I/O-3] ^[[39mDEBUG^[[0;39m o.r.s.h.ResponseInterceptorsStreamSinkConduit - Executing response interceptor TokenCORSResponseInterceptor for /collection/_streams/changestream
11:40:33.605 [XNIO-2 I/O-3] ^[[34mINFO ^[[0;39m o.r.security.handlers.RequestLogger - GET http://domain:8080/collection/_streams/changestream?avars={'n': 'Device 1'} from /89.211.175.90:53774 => status=^[[31;1m500^[[m elapsed=8ms contentLength=212 username=user roles=[admin]
11:42:40.243 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - tokenBasicAuthMechanism -> NOT_ATTEMPTED
11:42:40.243 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - basicAuthMechanism -> NOT_ATTEMPTED
11:42:40.243 [XNIO-2 task-1] ^[[34mINFO ^[[0;39m o.r.security.handlers.RequestLogger - GET http://IP:8080/ from /139.162.111.98:56622 => status=^[[31;1m401^[[m elapsed=1ms contentLength=0
11:56:06.750 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - tokenBasicAuthMechanism -> NOT_ATTEMPTED
11:56:06.761 [XNIO-2 task-1] ^[[31mWARN ^[[0;39m c.r.s.p.a.RHAuthenticator - Cannot find account
11:56:06.761 [XNIO-2 task-1] ^[[39mDEBUG^[[0;39m o.r.security.plugins.AuthMechanism - basicAuthMechanism -> NOT_AUTHENTICATED
11:56:06.761 [XNIO-2 task-1] ^[[34mINFO ^[[0;39m o.r.security.handlers.RequestLogger - GET http://IP:8080/manager/html from /60.191.66.222:53178 => status=^[[31;1m401^[[m elapsed=11ms contentLength=0
ujibang commented 4 years ago

From log seems an auth issue.

If using rhAuthenticator and have remapped your resource, make sure to reconfigure the property users-collection-uri: /remapped/users of rhAuthenticator in restheart-platform-security.yml

However there is a know bug in streams affecting until 4.1.7. We are workin on it and fixing in upcoming 4.1.8

mkjsix commented 4 years ago

Platform v 4.1.8 has been released.

https://download.restheart.com/restheart-platform-4.1.8.zip