AuthenticationHandler(AuthenticationHandler other) : base((Handler)other.Target.Clone(), other.Value) { AuthenticationType = other.AuthenticationType; Flags = other.Flags; Manager = new AuthenticationManager(AuthenticationType, GetCredentials()); cloneable = true; }
protected override HttpResponse OnUnauthenticated(HttpRequest request, string token, bool omitBody) { var handler = new AuthenticationHandler(this); if (omitBody) { handler.Flags |= RequestFlags.NoBody; } handler.Flags |= RequestFlags.Redirected; ((HttpConnection)request.Connection).Server.RegisterHandler(request.Path, handler); var response = new HttpResponse(HttpStatusCode.Unauthorized); response.AddHeader("WWW-Authenticate", token); return(response); }