Quantcast
Channel: Mattermost Discussion Forums - Latest posts
Viewing all articles
Browse latest Browse all 25778

How to Pass Credentials to Websocket from external domain?

$
0
0

Hello

We have built an implementation of MM using the api inside our app however we can not get the websocket connection authenticated . The websocket works as expected from inside the app if we actually log into Mattermost directly on the mattermost server. I assume this is because logging into Mattermost on the server sets the cookie .... but ... we need to be able to pass the token / cookie from our app.

I have tried the following;

var dataStream = $websocket('wss://chat.ourmattermostserver.com/api/v3/users/websocket?access_token='+$rootScope.mmToken);

var dataStream = $websocket('wss://chat.ourmattermostserver.com/api/v3/users/websocket', $rootScope.bearerMMToken); (i dont think you can pass headers to websocket so not surprised this didnt work) ...

Does anyone have any suggestions? This is quite urgent as we have a demo coming this Friday and this needs to work ..

Thank you.

Keith


Viewing all articles
Browse latest Browse all 25778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>