Integrating into Website


#1

Hi All,

I am trying to integrate Rocket into my website, I have been looking at the documentation but do not understand exactly how to do that as an iframe. I pretty much want the iframe to autologin as a defined a user that I define into a channel. Im just unsure how to layout the iframe and rest api. Any help would be awesome


#2

Having the same issue. SSO is showing a bar on the login screen which is not useful. There should be documentation for implementing auto login using different ways.


#3

This is doable but it takes quite a lot of digging since the documentation is uhmm bad and poorly written. Here’s what I did (Note that it’s close but It doesn’t work for me completely at this point)

First you setup an account in your rocketchat server that has admin privileges. You will use this account using REST calls to automatically create user accounts.

https://rocket.chat/docs/developer-guides/rest-api/users/create/

I would advise that this is done in a server you write, something in PHP, Pythin or JEE, because you don’t want to have these credentials floating around in your webpage.

Use the same code to log the user into your rocketchat instance with the newly created account:

https://rocket.chat/docs/developer-guides/rest-api/authentication/

You will get a JSON object back that has a token. You can then use that token to call postMessage on the iframe where you have rocketchat embedded, as per:

https://rocket.chat/docs/developer-guides/iframe-integration/commands/

I’m stuck on this one myself. This should all work according the documentation but I’m seeing an error in the iframe running rocketchat.