diff --git a/samples/CookieSample/Startup.cs b/samples/CookieSample/Startup.cs index cff673d752..aae3191ac2 100644 --- a/samples/CookieSample/Startup.cs +++ b/samples/CookieSample/Startup.cs @@ -2,6 +2,7 @@ using System.Security.Claims; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Security.Cookies; +using Microsoft.AspNet.Security.DataProtection; namespace CookieSample { @@ -9,6 +10,11 @@ namespace CookieSample { public void Configure(IApplicationBuilder app) { + app.UseServices(services => + { + services.Add(DataProtectionServices.GetDefaultServices()); + }); + app.UseCookieAuthentication(options => { }); diff --git a/samples/CookieSessionSample/Startup.cs b/samples/CookieSessionSample/Startup.cs index 2b6cfd8464..72a5c1ff97 100644 --- a/samples/CookieSessionSample/Startup.cs +++ b/samples/CookieSessionSample/Startup.cs @@ -3,6 +3,7 @@ using System.Security.Claims; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Security.Cookies; +using Microsoft.AspNet.Security.DataProtection; namespace CookieSessionSample { @@ -10,6 +11,11 @@ namespace CookieSessionSample { public void Configure(IApplicationBuilder app) { + app.UseServices(services => + { + services.Add(DataProtectionServices.GetDefaultServices()); + }); + app.UseCookieAuthentication(options => { options.SessionStore = new MemoryCacheSessionStore(); diff --git a/samples/SocialSample/Startup.cs b/samples/SocialSample/Startup.cs index 162a1b5539..f6070b9ff7 100644 --- a/samples/SocialSample/Startup.cs +++ b/samples/SocialSample/Startup.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Net.Http; using System.Net.Http.Headers; using System.Security.Claims; @@ -8,13 +6,12 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Security; using Microsoft.AspNet.Security.Cookies; -using Microsoft.AspNet.Security.Facebook; +using Microsoft.AspNet.Security.DataProtection; using Microsoft.AspNet.Security.Google; using Microsoft.AspNet.Security.MicrosoftAccount; using Microsoft.AspNet.Security.OAuth; -using Microsoft.AspNet.Security.Twitter; -using Newtonsoft.Json.Linq; using Microsoft.Framework.DependencyInjection; +using Newtonsoft.Json.Linq; namespace CookieSample { @@ -26,6 +23,7 @@ namespace CookieSample app.UseServices(services => { + services.Add(DataProtectionServices.GetDefaultServices()); services.Configure(options => { options.SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType;