RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
125 stars 251 forks source link

Login with RC auth token #212

Closed goran-paunovic closed 1 year ago

goran-paunovic commented 1 year ago

I don't know where should I ask this question. If this is not the right place, please delete it.

I need to: My app already has users and whenever user is logged in we can get auth_token from RocketChat server. I can user this auth_token to login user to RC when I use iFrame. Is something like that possible wit EmbeddedChat? I can see that it's possible to login with Google but other than that? If not, how can I add such functionality? What part of code should I inspect?

sidmohanty11 commented 1 year ago

Hey @goran-paunovic ! We are going to upgrade our Auth system to support everything that RC supports. In short, use RC as a middleware for logging into all the OAuth providers. As of now, you can use the auth_token and store it in your site as rc_token and you'll get automatically logged in. So, yeah it does work but if the token is lost or you're logging out you would need an auth mechanism for getting the token and storing it.

But stay tuned for the latest Auth upgrade. It will be awesome as any provider you add to RC, it will be automatically added to EC as well. : )

goran-paunovic commented 1 year ago

Thank you @sidmohanty11 . I'm looking forward to this Auth system upgrades and I hope I will be able to contribute to the project in the future. Keep up the good work.

abhinavkrin commented 1 year ago

Solved with the introduction of the auth package. Set auth={ flow: "TOKEN", credentials: {resume_token: "your-token"} }