Claims Authentication (ADFS &STS)
-
09-12-2019 - |
Question
Can i have ADFS authentication mechanism for 1 subsite and SSO implementation for 3-4 subsites ? i am using Claims based authentication.I have ADFS already configured.I have 1 webapplication and have around 12 subsites.Each subsite represent 1 client.Everythings fine. Now i am planning to implement SSO for 2 clients and rest clients needs to work with the ADFS.But for claims if i have 2 authentication provider STS&ADFS.i would get
I don't want SSO to use this page ,instead they should be taken directly to the Sharepoint Site without credentials.And ADFS should be taken to the ADFS login page .FYI I am using SAML 2.0 to SAML 1.1 conversion to implement SSO
Solution 2
Finally i got it to work :
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);
}
}
OTHER TIPS
Authentication is managed at the web application level only. It is not possible to have sites within the same web application use different authentication providers unless the entire application supports those providers.
Maybe this article will help: http://msdn.microsoft.com/en-us/library/hh237665.aspx