diff --git a/samples/CookieSample/Startup.cs b/samples/CookieSample/Startup.cs index aae3191ac2..7e481c220e 100644 --- a/samples/CookieSample/Startup.cs +++ b/samples/CookieSample/Startup.cs @@ -2,7 +2,7 @@ using System.Security.Claims; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Security.Cookies; -using Microsoft.AspNet.Security.DataProtection; +using Microsoft.Framework.DependencyInjection; namespace CookieSample { @@ -12,7 +12,7 @@ namespace CookieSample { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); }); app.UseCookieAuthentication(options => diff --git a/samples/CookieSessionSample/Startup.cs b/samples/CookieSessionSample/Startup.cs index 72a5c1ff97..ff72c04694 100644 --- a/samples/CookieSessionSample/Startup.cs +++ b/samples/CookieSessionSample/Startup.cs @@ -3,7 +3,7 @@ using System.Security.Claims; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Security.Cookies; -using Microsoft.AspNet.Security.DataProtection; +using Microsoft.Framework.DependencyInjection; namespace CookieSessionSample { @@ -13,7 +13,7 @@ namespace CookieSessionSample { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); }); app.UseCookieAuthentication(options => diff --git a/samples/SocialSample/Startup.cs b/samples/SocialSample/Startup.cs index f6070b9ff7..6e7b5c6323 100644 --- a/samples/SocialSample/Startup.cs +++ b/samples/SocialSample/Startup.cs @@ -23,7 +23,7 @@ namespace CookieSample app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); services.Configure(options => { options.SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType; diff --git a/test/Microsoft.AspNet.Security.Test/Cookies/CookieMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/Cookies/CookieMiddlewareTests.cs index a5ca8bcaf7..b103a7c757 100644 --- a/test/Microsoft.AspNet.Security.Test/Cookies/CookieMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/Cookies/CookieMiddlewareTests.cs @@ -15,8 +15,8 @@ using System.Xml.Linq; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Security; -using Microsoft.AspNet.Security.DataProtection; using Microsoft.AspNet.TestHost; +using Microsoft.Framework.DependencyInjection; using Shouldly; using Xunit; @@ -368,7 +368,7 @@ namespace Microsoft.AspNet.Security.Cookies { return TestServer.Create(app => { - app.UseServices(services => services.Add(DataProtectionServices.GetDefaultServices())); + app.UseServices(services => services.AddDataProtection()); app.UseCookieAuthentication(configureOptions); app.Use(async (context, next) => { diff --git a/test/Microsoft.AspNet.Security.Test/Facebook/FacebookMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/Facebook/FacebookMiddlewareTests.cs index 1749a6ffe3..7377d1a1f1 100644 --- a/test/Microsoft.AspNet.Security.Test/Facebook/FacebookMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/Facebook/FacebookMiddlewareTests.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Security.Facebook { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); services.ConfigureFacebookAuthentication(options => { options.AppId = "Test App Id"; @@ -71,7 +71,7 @@ namespace Microsoft.AspNet.Security.Facebook { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); services.ConfigureFacebookAuthentication(options => { options.AppId = "Test App Id"; diff --git a/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs index e9169baf3c..5b6046aa9c 100644 --- a/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs @@ -467,7 +467,7 @@ namespace Microsoft.AspNet.Security.Google { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); services.Configure(options => { options.SignInAsAuthenticationType = CookieAuthenticationType; diff --git a/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs index 6a5cb84f39..8fd06d8c97 100644 --- a/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs @@ -165,7 +165,7 @@ namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); services.Configure(options => { options.SignInAsAuthenticationType = "External"; diff --git a/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs index a1d6c095fe..36a829404b 100644 --- a/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs @@ -112,7 +112,7 @@ namespace Microsoft.AspNet.Security.Twitter { app.UseServices(services => { - services.Add(DataProtectionServices.GetDefaultServices()); + services.AddDataProtection(); services.Configure(options => { options.SignInAsAuthenticationType = "External";