SPWebApplication app = SPContext.Current.Site.WebApplication;
SPAlternateUrl u = app.AlternateUrls[Request.Url];
SPUrlZone zone = u.UrlZone;
SPIisSettings settings = app.IisSettings[zone];
string components = Request.Url.GetComponents(UriComponents.Query, UriFormat.SafeUnescaped);
string AuthProviderString;
if (flag == 1)
AuthProviderString = "SAML_STS";
else
AuthProviderString = "Staging External Users";
foreach (SPAuthenticationProvider provider in settings.ClaimsAuthenticationProviders)
{
if (string.Compare(provider.DisplayName, AuthProviderString, true, System.Globalization.CultureInfo.CurrentUICulture) == 0
|| string.Compare(provider.ClaimProviderName, AuthProviderString, true, System.Globalization.CultureInfo.CurrentUICulture) == 0)
{
string url = provider.AuthenticationRedirectionUrl.ToString();
SPUtility.Redirect(url, SPRedirectFlags.Default, this.Context, components);
}
}
I had to take a copy of C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IDENTITYMODEL\LOGIN and then override the default.aspx with my new class library.
http://blog.repsaj.nl/index.php/2010/05/sp2010-creating-a-mixed-mode-login-page-for-claims-based-authentication/