internal static IHttpAuthenticationFeature GetAuthentication(this HttpContext context)
 {
     var auth = context.GetFeature<IHttpAuthenticationFeature>();
     if (auth == null)
     {
         auth = new HttpAuthenticationFeature();
         context.SetFeature<IHttpAuthenticationFeature>(auth);
     }
     return auth;
 }
 public static IHttpAuthenticationFeature GetAuthentication(this HttpContext context)
 {
     var auth = context.Features.Get<IHttpAuthenticationFeature>();
     if (auth == null)
     {
         auth = new HttpAuthenticationFeature();
         context.Features.Set(auth);
     }
     return auth;
 }
 private void AttachAuthenticationHandler(AuthenticationHandler handler)
 {
     var auth = handler.HttpContext.Features.Get<IHttpAuthenticationFeature>();
     if (auth == null)
     {
         auth = new HttpAuthenticationFeature();
         handler.HttpContext.Features.Set(auth);
     }
     handler.PriorHandler = auth.Handler;
     auth.Handler = handler;
 }