How can I integrate my custom OAuth and rocket chat

Hi, I’m working on creating a custom authentication user interface for my Rocket.Chat application. For this, I’m using AWS Cognito and the AWS SDK for communication with Cognito. I’m not using the default user interface provided by Cognito, as it is quite basic in design. Instead, I have developed my own custom user interface and connected it to Cognito through SDK calls.

Now, I’m facing a challenge: how can I integrate this with my Rocket.Chat application? I noticed that in the workspace under settings > OAuth, we can create a custom OAuth and provide all the necessary integration values. However, I need guidance on how to implement this so that when a user is successfully authenticated with Cognito, they are redirected to my Rocket.Chat application’s home page from the login screen.