Exemplo n.º 1
0
 /// <summary>
 /// Extension method adding middleware
 /// </summary>
 /// <param name="app">IAppBuilder instance to extend</param>
 /// <param name="options">Options of type. See <see cref="BasicWindowsAuthenticationOptions">BasicWindowsAuthenticationOptions</see></param>
 /// <returns></returns>
 public static IAppBuilder UseBasicWindowsAuthentication(this IAppBuilder app, BasicWindowsAuthenticationOptions options)
 {
     return(app.Use <BasicWindowsAuthenticationMiddleware>(options));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Extension method adding middleware
        /// </summary>
        /// <param name="app">IAppBuilder instance to extend</param>
        /// <param name="realm">Realm to display in challenge</param>
        /// <param name="defaultDomain">Default domain to be used if no domain is specified</param>
        /// <param name="failSilently">If set to false, response header will contain failure cause. See (<see cref="BasicWindowsAuthenticationOptions">BasicWindowsAuthenticationOptions</see>)</param>
        /// <returns></returns>
        public static IAppBuilder UseBasicWindowsAuthentication(this IAppBuilder app, string realm, string defaultDomain, bool failSilently)
        {
            var options = new BasicWindowsAuthenticationOptions(realm, defaultDomain, failSilently);

            return(app.UseBasicWindowsAuthentication(options));
        }