Beispiel #1
0
        /// <summary>
        /// Enables HTTP Basic Auth with users stored in the application configuration file (Web.config or App.config).
        /// </summary>
        public static HttpConfiguration EnableBasicAuth(this HttpConfiguration configuration)
        {
            var basicAuthConfig = BasicAuthSection.Load();

            if (basicAuthConfig != null)
            {
                configuration.Filters.Add(new BasicAuthFilter(basicAuthConfig));
            }
            return(configuration);
        }
Beispiel #2
0
 /// <summary>
 /// Creates a new HTTP Basic Authentication handler.
 /// </summary>
 /// <param name="config">The configuration specifying the valid users.</param>
 public BasicAuthFilter(BasicAuthSection config)
 {
     _config = config;
 }
 /// <summary>
 /// Creates a new HTTP Basic Authentication handler.
 /// </summary>
 /// <param name="config">The configuration specifying the valid users.</param>
 public BasicAuthFilter(BasicAuthSection config)
 {
     _config = config;
 }