SAML SSO doesn’t require a new browser tab to be opened. Typically the SSO flow occurs in the same browser window.
Once the user clicks the link or button etc and the HTTP request in the new browser tab comes back to your application, you call our SAML API to initiate SSO.
There are many ways to do this. The following demonstrates one possibility.
The HTML body includes a link that the browser will open in a new tab.
<h1>Login to the Service Provider</h1>
<a href="/InitiateSSO.aspx" target="_blank">SSO to the Identity Provider</a>
The code behind for this page initiates SSO in this newly opened tab.
protected void Page_Load(object sender, EventArgs e)
// Remember the return URL.
string returnUrl = Request.QueryString["ReturnUrl"];
// To login at the service provider, initiate single sign-on to the identity provider (SP-initiated SSO).
string partnerIdP = WebConfigurationManager.AppSettings[AppSettings.PartnerIdP];
SAMLServiceProvider.InitiateSSO(Response, returnUrl, partnerIdP);