Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit 240ed82

Browse files
committed
React to AddDataProtection change
1 parent 5f06906 commit 240ed82

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

samples/CookieSample/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Microsoft.AspNet.Builder;
33
using Microsoft.AspNet.Http;
44
using Microsoft.AspNet.Security.Cookies;
5-
using Microsoft.AspNet.Security.DataProtection;
5+
using Microsoft.Framework.DependencyInjection;
66

77
namespace CookieSample
88
{
@@ -12,7 +12,7 @@ public void Configure(IApplicationBuilder app)
1212
{
1313
app.UseServices(services =>
1414
{
15-
services.Add(DataProtectionServices.GetDefaultServices());
15+
services.AddDataProtection();
1616
});
1717

1818
app.UseCookieAuthentication(options =>

samples/CookieSessionSample/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.AspNet.Builder;
44
using Microsoft.AspNet.Http;
55
using Microsoft.AspNet.Security.Cookies;
6-
using Microsoft.AspNet.Security.DataProtection;
6+
using Microsoft.Framework.DependencyInjection;
77

88
namespace CookieSessionSample
99
{
@@ -13,7 +13,7 @@ public void Configure(IApplicationBuilder app)
1313
{
1414
app.UseServices(services =>
1515
{
16-
services.Add(DataProtectionServices.GetDefaultServices());
16+
services.AddDataProtection();
1717
});
1818

1919
app.UseCookieAuthentication(options =>

samples/SocialSample/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void Configure(IApplicationBuilder app)
2323

2424
app.UseServices(services =>
2525
{
26-
services.Add(DataProtectionServices.GetDefaultServices());
26+
services.AddDataProtection();
2727
services.Configure<ExternalAuthenticationOptions>(options =>
2828
{
2929
options.SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType;

test/Microsoft.AspNet.Security.Test/Cookies/CookieMiddlewareTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
using Microsoft.AspNet.Builder;
1616
using Microsoft.AspNet.Http;
1717
using Microsoft.AspNet.Http.Security;
18-
using Microsoft.AspNet.Security.DataProtection;
1918
using Microsoft.AspNet.TestHost;
19+
using Microsoft.Framework.DependencyInjection;
2020
using Shouldly;
2121
using Xunit;
2222

@@ -368,7 +368,7 @@ private static TestServer CreateServer(Action<CookieAuthenticationOptions> confi
368368
{
369369
return TestServer.Create(app =>
370370
{
371-
app.UseServices(services => services.Add(DataProtectionServices.GetDefaultServices()));
371+
app.UseServices(services => services.AddDataProtection());
372372
app.UseCookieAuthentication(configureOptions);
373373
app.Use(async (context, next) =>
374374
{

test/Microsoft.AspNet.Security.Test/Facebook/FacebookMiddlewareTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task ChallengeWillTriggerApplyRedirectEvent()
2727
{
2828
app.UseServices(services =>
2929
{
30-
services.Add(DataProtectionServices.GetDefaultServices());
30+
services.AddDataProtection();
3131
services.ConfigureFacebookAuthentication(options =>
3232
{
3333
options.AppId = "Test App Id";
@@ -71,7 +71,7 @@ public async Task ChallengeWillTriggerRedirection()
7171
{
7272
app.UseServices(services =>
7373
{
74-
services.Add(DataProtectionServices.GetDefaultServices());
74+
services.AddDataProtection();
7575
services.ConfigureFacebookAuthentication(options =>
7676
{
7777
options.AppId = "Test App Id";

test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ private static TestServer CreateServer(Action<GoogleAuthenticationOptions> confi
467467
{
468468
app.UseServices(services =>
469469
{
470-
services.Add(DataProtectionServices.GetDefaultServices());
470+
services.AddDataProtection();
471471
services.Configure<ExternalAuthenticationOptions>(options =>
472472
{
473473
options.SignInAsAuthenticationType = CookieAuthenticationType;

test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private static TestServer CreateServer(Action<MicrosoftAccountAuthenticationOpti
165165
{
166166
app.UseServices(services =>
167167
{
168-
services.Add(DataProtectionServices.GetDefaultServices());
168+
services.AddDataProtection();
169169
services.Configure<ExternalAuthenticationOptions>(options =>
170170
{
171171
options.SignInAsAuthenticationType = "External";

test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private static TestServer CreateServer(Action<IApplicationBuilder> configure, Fu
112112
{
113113
app.UseServices(services =>
114114
{
115-
services.Add(DataProtectionServices.GetDefaultServices());
115+
services.AddDataProtection();
116116
services.Configure<ExternalAuthenticationOptions>(options =>
117117
{
118118
options.SignInAsAuthenticationType = "External";

0 commit comments

Comments
 (0)