# Redirect to SSO login page automatically

**URL:** <https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668>\
**Category:** Get Help\
**Tags:** sso\
**Created:** [July 25, 2024, 3:29pm UTC](https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668 "2024-07-25T15:29:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyFromLeeds](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AndyFromLeeds](https://community.fliplet.com/u/AndyFromLeeds)\
**Post date:** [July 25, 2024, 3:29pm UTC](https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668/1 "2024-07-25T15:29:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)\
**Post date:** [July 25, 2024, 4:16pm UTC](https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668/2 "2024-07-25T16:16:25Z")

</div>

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.

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

```

Hope this helps,  
Deb

---

<div class="post-metadata">

**Author:** ![AndyFromLeeds](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AndyFromLeeds](https://community.fliplet.com/u/AndyFromLeeds)\
**Post date:** [July 25, 2024, 4:52pm UTC](https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668/3 "2024-07-25T16:52:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Deb](https://dub1.discourse-cdn.com/flex017/user_avatar/community.fliplet.com/deb/32/159_2.png) [@Deb](https://community.fliplet.com/u/Deb)\
**Post date:** [July 26, 2024, 10:40am UTC](https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668/4 "2024-07-26T10:40:41Z")

</div>

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.

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

```

See docs: [Navigate | Fliplet Developers Documentation](https://developers.fliplet.com/API/core/navigate.html#navigate-the-app-to-a-url)

Thanks,  
Deb

---

<div class="post-metadata">

**Author:** ![AndyFromLeeds](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AndyFromLeeds](https://community.fliplet.com/u/AndyFromLeeds)\
**Post date:** [July 26, 2024, 11:06am UTC](https://community.fliplet.com/t/redirect-to-sso-login-page-automatically/668/5 "2024-07-26T11:06:11Z")

</div>

Thanks again Deb.

I tried it with a redirect to [BBC - Home](https://www.bbc.co.uk/) 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
