0

I am using Rocket chat inside my javascript based web app as an iframe ( https://rocket.chat/docs/developer-guides/iframe-integration ).. I have setup SAML auth for rocket chat and the same is being used by my web app. However the iframe is not auto authed, it shows the login screen with a "Saml Login" button. If i click it then I am able to login.

Is there any way to trigger saml auth on behalf of RocketChat iFrame without having to click on the "SAML Login" button that comes on the Rocket Chat login page?

Basically is there any call that I can make on behalf of RocketChat to auto authenticate it?

1 Answers1

0

Well you can use a JavaScript library like JQuery for automating the button click. See this link: https://api.jquery.com/click/. The following command will click a button with id "button-id":

$( "#button-id" ).click();

If you want the login button and login page to remain invisible on page load, then you can hide the page body using CSS. For example:

body {
  display: none;
}
Nadir Latif
  • 3,690
  • 1
  • 15
  • 24