diff --git a/src/Microsoft.AspNet.Security.Cookies/CookieAuthenticationExtensions.cs b/src/Microsoft.AspNet.Security.Cookies/CookieAuthenticationExtensions.cs
index 91109f4cef..ad683ac21f 100644
--- a/src/Microsoft.AspNet.Security.Cookies/CookieAuthenticationExtensions.cs
+++ b/src/Microsoft.AspNet.Security.Cookies/CookieAuthenticationExtensions.cs
@@ -18,15 +18,12 @@ namespace Microsoft.AspNet.Builder
///
/// Adds a cookie-based authentication middleware to your web application pipeline.
///
- /// The IAppBuilder passed to your configuration method
+ /// The IBuilder passed to your configuration method
/// An options class that controls the middleware behavior
/// The original app parameter
public static IBuilder UseCookieAuthentication([NotNull] this IBuilder app, [NotNull] CookieAuthenticationOptions options)
{
- // TODO: Use UseMiddleware to inject dependencies once it can discover Invoke from a base class.
- var dataProtectionProvider = app.ApplicationServices.GetService();
- var loggerFactory = app.ApplicationServices.GetService();
- return app.Use(next => new CookieAuthenticationMiddleware(next, dataProtectionProvider, loggerFactory, options).Invoke);
+ return app.UseMiddleware(options);
}
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Security.Cookies/project.json b/src/Microsoft.AspNet.Security.Cookies/project.json
index f16f0f5d02..01d75ff080 100644
--- a/src/Microsoft.AspNet.Security.Cookies/project.json
+++ b/src/Microsoft.AspNet.Security.Cookies/project.json
@@ -5,7 +5,8 @@
"Microsoft.AspNet.Http": "0.1-alpha-*",
"Microsoft.AspNet.HttpFeature": "0.1-alpha-*",
"Microsoft.AspNet.PipelineCore": "0.1-alpha-*",
- "Microsoft.AspNet.Security": "0.1-alpha-*",
+ "Microsoft.AspNet.RequestContainer": "0.1-alpha-*",
+ "Microsoft.AspNet.Security": "",
"Microsoft.AspNet.Security.DataProtection": "0.1-alpha-*",
"Microsoft.Framework.DependencyInjection": "0.1-alpha-*",
"Microsoft.Framework.Logging": "0.1-alpha-*",