React to AddDataProtection change

This commit is contained in:
Hao Kung 2014-11-24 16:32:33 -08:00
parent 5f06906087
commit 240ed82b31
8 changed files with 12 additions and 12 deletions

View File

@ -2,7 +2,7 @@ using System.Security.Claims;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.DataProtection; using Microsoft.Framework.DependencyInjection;
namespace CookieSample namespace CookieSample
{ {
@ -12,7 +12,7 @@ namespace CookieSample
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
}); });
app.UseCookieAuthentication(options => app.UseCookieAuthentication(options =>

View File

@ -3,7 +3,7 @@ using System.Security.Claims;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.DataProtection; using Microsoft.Framework.DependencyInjection;
namespace CookieSessionSample namespace CookieSessionSample
{ {
@ -13,7 +13,7 @@ namespace CookieSessionSample
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
}); });
app.UseCookieAuthentication(options => app.UseCookieAuthentication(options =>

View File

@ -23,7 +23,7 @@ namespace CookieSample
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
services.Configure<ExternalAuthenticationOptions>(options => services.Configure<ExternalAuthenticationOptions>(options =>
{ {
options.SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType; options.SignInAsAuthenticationType = CookieAuthenticationDefaults.AuthenticationType;

View File

@ -15,8 +15,8 @@ using System.Xml.Linq;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.TestHost; using Microsoft.AspNet.TestHost;
using Microsoft.Framework.DependencyInjection;
using Shouldly; using Shouldly;
using Xunit; using Xunit;
@ -368,7 +368,7 @@ namespace Microsoft.AspNet.Security.Cookies
{ {
return TestServer.Create(app => return TestServer.Create(app =>
{ {
app.UseServices(services => services.Add(DataProtectionServices.GetDefaultServices())); app.UseServices(services => services.AddDataProtection());
app.UseCookieAuthentication(configureOptions); app.UseCookieAuthentication(configureOptions);
app.Use(async (context, next) => app.Use(async (context, next) =>
{ {

View File

@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Security.Facebook
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
services.ConfigureFacebookAuthentication(options => services.ConfigureFacebookAuthentication(options =>
{ {
options.AppId = "Test App Id"; options.AppId = "Test App Id";
@ -71,7 +71,7 @@ namespace Microsoft.AspNet.Security.Facebook
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
services.ConfigureFacebookAuthentication(options => services.ConfigureFacebookAuthentication(options =>
{ {
options.AppId = "Test App Id"; options.AppId = "Test App Id";

View File

@ -467,7 +467,7 @@ namespace Microsoft.AspNet.Security.Google
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
services.Configure<ExternalAuthenticationOptions>(options => services.Configure<ExternalAuthenticationOptions>(options =>
{ {
options.SignInAsAuthenticationType = CookieAuthenticationType; options.SignInAsAuthenticationType = CookieAuthenticationType;

View File

@ -165,7 +165,7 @@ namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
services.Configure<ExternalAuthenticationOptions>(options => services.Configure<ExternalAuthenticationOptions>(options =>
{ {
options.SignInAsAuthenticationType = "External"; options.SignInAsAuthenticationType = "External";

View File

@ -112,7 +112,7 @@ namespace Microsoft.AspNet.Security.Twitter
{ {
app.UseServices(services => app.UseServices(services =>
{ {
services.Add(DataProtectionServices.GetDefaultServices()); services.AddDataProtection();
services.Configure<ExternalAuthenticationOptions>(options => services.Configure<ExternalAuthenticationOptions>(options =>
{ {
options.SignInAsAuthenticationType = "External"; options.SignInAsAuthenticationType = "External";