Accounts login/signups integration

Hi,
I’m currently developing a spring boot app (J2EE) and I have a Rocket.chat instance that should be integrated with it just in the authentication part.
So I got my spring boot app where users can create their accounts and it should also gets created on the rocket.chat automatically also when an existent user login to my spring boot app he also get logged in to rocket.chat automatically. so when he go to my Rocket.chat link he’ll find himself already logged in.
I searched the rockets.chat docs, I saw many authentication options but I don’t know which one will work for me, and how I’ll get it to work.

It would be great if someone could help me or link me to a tutorial to help me set this up.

PS: the Spring boot app use a MySQL database to store users information

Really depends on what you are familiar with. Personally I’d recommend oauth or something for simplicity. But you’d probably have to write something your self

1 Like

Thanks for your answer,
Is there any tutorial or documentation about this that I can follow along
also the signin/signups should be on my spring boot app side not the rocket.chat side

Since implementing your own oauth server requires writing custom code on your spring boot side… No :). But I’m sure if you Google it you’ll find something.

Once you have that coded check out our documentation for how to setup oauth with Rocket.Chat

1 Like

Okay thank you for your help.

I have another question, How can I manage roles from my Spring App?
I have 3 types of roles on my Spring app I want when an account in a specific role get created on my App it gets created with that same role on my Rocket.Chat instance, I don’t think Oauth could achieve that.

beside that I might need at a certain time on my Spring app to send some notification/message to rocket.chat user private conversations .

You are correct about oauth not being able to deliver role.

I’d take a look maybe at our rest api

Thanks for your answer, I’ve been checking your rest API docs lately but honestly I’m having some difficulties understanding it, Could you please link me to a tutorial or and a code example using it please ?

The docs for each end point has an example of using it with curl. Shows params needed, and payload structure. Just look for guides in using rest api with your language and framework. And apply what you learn to rocket.chats api

If you want code examples see our Android and iOS code bases which use the API.