Ansprüche Authentifizierung (ADFS & STS)
-
09-12-2019 - |
Frage
Kann ich ADFS-Authentifizierungsmechanismus für 1 Subsite- und SSO-Implementierung für 3-4-Unterbahnen haben? Ich verwende die Ansprüche basierende Authentifizierung Jetzt plane ich, SSO für 2 Clients zu implementieren, und REST-Clients müssen mit den ADFs zusammenarbeiten, wenn ich 2 Authentifizierungsanbieter STS & ADFS habe. Ich würde
Ich möchte nicht, dass SSO diese Seite verwenden soll, stattdessen sollten sie ohne Anmeldeinformationen direkt zum SharePoint-Site übernommen werden. Und ADFs sollte auf die ADFS-Anmeldeseite werden .FYI Ich verwende SAML 2.0, um SAML 1.1-Umwandlung zu implementierenSso
Lösung 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);
}
}
Andere Tipps
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