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

Commit 977a08d

Browse files
committed
Add DataProtection to samples.
1 parent b37966f commit 977a08d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

samples/CookieSample/Startup.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
using Microsoft.AspNet.Builder;
33
using Microsoft.AspNet.Http;
44
using Microsoft.AspNet.Security.Cookies;
5+
using Microsoft.AspNet.Security.DataProtection;
56

67
namespace CookieSample
78
{
89
public class Startup
910
{
1011
public void Configure(IApplicationBuilder app)
1112
{
13+
app.UseServices(services =>
14+
{
15+
services.Add(DataProtectionServices.GetDefaultServices());
16+
});
17+
1218
app.UseCookieAuthentication(options =>
1319
{
1420
});

samples/CookieSessionSample/Startup.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
33
using Microsoft.AspNet.Builder;
44
using Microsoft.AspNet.Http;
55
using Microsoft.AspNet.Security.Cookies;
6+
using Microsoft.AspNet.Security.DataProtection;
67

78
namespace CookieSessionSample
89
{
910
public class Startup
1011
{
1112
public void Configure(IApplicationBuilder app)
1213
{
14+
app.UseServices(services =>
15+
{
16+
services.Add(DataProtectionServices.GetDefaultServices());
17+
});
18+
1319
app.UseCookieAuthentication(options =>
1420
{
1521
options.SessionStore = new MemoryCacheSessionStore();

samples/SocialSample/Startup.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
31
using System.Net.Http;
42
using System.Net.Http.Headers;
53
using System.Security.Claims;
@@ -8,13 +6,12 @@
86
using Microsoft.AspNet.Http.Security;
97
using Microsoft.AspNet.Security;
108
using Microsoft.AspNet.Security.Cookies;
11-
using Microsoft.AspNet.Security.Facebook;
9+
using Microsoft.AspNet.Security.DataProtection;
1210
using Microsoft.AspNet.Security.Google;
1311
using Microsoft.AspNet.Security.MicrosoftAccount;
1412
using Microsoft.AspNet.Security.OAuth;
15-
using Microsoft.AspNet.Security.Twitter;
16-
using Newtonsoft.Json.Linq;
1713
using Microsoft.Framework.DependencyInjection;
14+
using Newtonsoft.Json.Linq;
1815

1916
namespace CookieSample
2017
{
@@ -26,6 +23,7 @@ public void Configure(IApplicationBuilder app)
2623

2724
app.UseServices(services =>
2825
{
26+
services.Add(DataProtectionServices.GetDefaultServices());
2927
services.Configure<ExternalAuthenticationOptions>(options =>
3028
{
3129
options.SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType;

0 commit comments

Comments
 (0)