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);
                    }
                }
            }
        }
Exemplo n.º 2
0
        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));
        }