public void AddAuthenticationScheme(SCIMAuthenticationScheme authenticationScheme) { if (null == authenticationScheme) { throw new ArgumentNullException(nameof(authenticationScheme)); } if (string.IsNullOrWhiteSpace(authenticationScheme.Name)) { throw new ArgumentNullException(nameof(authenticationScheme)); } Func <bool> containsFunction = new Func <bool>( () => this .authenticationSchemes .Any( (SCIMAuthenticationScheme item) => string.Equals(item.Name, authenticationScheme.Name, StringComparison.OrdinalIgnoreCase))); if (!containsFunction()) { lock (this.thisLock) { if (!containsFunction()) { this.authenticationSchemes.Add(authenticationScheme); } } } }
public ActionResult <ServiceConfiguration> Get() { ServiceConfiguration config = new ServiceConfiguration(false, false, true, false, true, false) { DocumentationResource = "http://example.com/help/scim.html" }; config.AddAuthenticationScheme(SCIMAuthenticationScheme.CreateOpenStandardForAuthorizationBearerTokenScheme()); return(this.Ok(config)); }