Single sign on using machine two machine

Hey guys, funny scenario for you, I’m trying to work out if the following is possible.

I’m looking to figure out if single sign-on can be simulated if an application A exists in an external tenant, then makes a redirect to application B which uses new universal login and exists in our tenant?

Any thoughts on this scenario?

I found this, presuming this is the way?

Hey all, I was able to get the SAML SSO sample working. The only thing I can get working is Logout. Although it logs the user out of the session, its obviously holding on the login session of the IDP as when clicking login, it just auto logins in rather opening new universal login page. Any idea regarding the logout for the sample above?