Redirect to SSO login page automatically

Hi,

my app is secured by SSO with the SAML widget and everything works.

However, I don’t want the user to see the screen with the ‘Log In’ button on it. It seems excessive to present the user with a ‘Log In’ page purely so they have a place to click a button to then present them the actual log in page which is my Azure Entra ID B2C log in screen.

How can I make it so that when the Fliplet SSO page is encountered it automatically redirects to my Azure Entra ID B2C log in page without the user clicking the button?

I tried the simple solution of using JQuery to click the button on page ready, but unsurprisingly this results in the browser popup blocker kicking in and stopping it.

Is there some way of programmatically triggering the SAML widget that won’t get popup blocked?

Thanks
Andy

Hi Andy,

We don’t have a way to programmatically trigger the SAML2 component. Your best bet is what you have already tried with jQuery. I’ve tried this before and it should work. You might need to adjust it for the classes on your button.

setTimeout(() => {
  Fliplet().then(function() {
    $('.sso-login.text-center > .btn.btn-primary').click();
  });
}, 3000);

Hope this helps,
Deb

Thanks for the super quick response Deb,

I have tried your suggestion (as you say it is similar to what I have already tried) but again it gets blocked as being a popup.

I don’t have any ad/popup blockers installed in Edge so this seems to be default behavior in the browser.

Do you have any other ideas or am I just fighting against the browser here? In such case how can I improve the log on experience?

Thanks
Andy

Hi Andy,

I see, I tried it in chrome and it works for me but yes its very likely you are fighting the edge browser.

You can try this as well but I can’t be sure it will work. You can add some code that on page load it just loads your Azure url. For e.g.

 Fliplet().then(function() {
   Fliplet.Navigate.url(''); //Add here the url of your Azure instance 
})

See docs: Navigate | Fliplet Developers Documentation

Thanks,
Deb

Thanks again Deb.

I tried it with a redirect to BBC - Home as redirecting to the Azure B2C login page requires the SAML2 payload for it to work.

Alas, still the same. There must be a way to achieve this that doesn’t get blocked as a popup by Edge - this is something pretty standard.

Thanks again
Andy