diff --git a/src/MusicStore.Spa/Models/SampleData.cs b/src/MusicStore.Spa/Models/SampleData.cs index f7a6c0b009..653353d792 100644 --- a/src/MusicStore.Spa/Models/SampleData.cs +++ b/src/MusicStore.Spa/Models/SampleData.cs @@ -31,7 +31,7 @@ namespace MusicStore.Models private static async Task CreateAdminUser(IServiceProvider serviceProvider) { - var settings = serviceProvider.GetService>().Options; + var settings = serviceProvider.GetService>().Value; const string adminRole = "Administrator"; var userManager = serviceProvider.GetService>(); diff --git a/src/MusicStore/Startup.cs b/src/MusicStore/Startup.cs index 3172d89def..1b49a243bd 100644 --- a/src/MusicStore/Startup.cs +++ b/src/MusicStore/Startup.cs @@ -57,34 +57,32 @@ namespace MusicStore } // Add Identity services to the services container - services.AddIdentity() + services.AddIdentity(options => + { + options.ApplicationCookie.AccessDeniedPath = new PathString("/Home/AccessDenied"); + }) .AddEntityFrameworkStores() .AddDefaultTokenProviders(); - services.ConfigureCookieAuthentication(options => - { - options.AccessDeniedPath = new PathString("/Home/AccessDenied"); - }); - - services.ConfigureFacebookAuthentication(options => + services.AddFacebookAuthentication(options => { options.AppId = "550624398330273"; options.AppSecret = "10e56a291d6b618da61b1e0dae3a8954"; }); - services.ConfigureGoogleAuthentication(options => + services.AddGoogleAuthentication(options => { options.ClientId = "977382855444.apps.googleusercontent.com"; options.ClientSecret = "NafT482F70Vjj_9q1PU4B0pN"; }); - services.ConfigureTwitterAuthentication(options => + services.AddTwitterAuthentication(options => { options.ConsumerKey = "9J3j3pSwgbWkgPFH7nAf0Spam"; options.ConsumerSecret = "jUBYkQuBFyqp7G3CUB9SW3AfflFr9z3oQBiNvumYy87Al0W4h8"; }); - services.ConfigureMicrosoftAccountAuthentication(options => + services.AddMicrosoftAccountAuthentication(options => { options.Caption = "MicrosoftAccount - Requires project changes"; options.ClientId = "000000004012C08A"; diff --git a/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs b/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs index 5966d653f0..42241082c2 100644 --- a/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs +++ b/test/E2ETests/compiler/shared/Mocks/StartupSocialTesting.cs @@ -68,16 +68,16 @@ namespace MusicStore } // Add Identity services to the services container - services.AddIdentity() + services.AddIdentity(options => + { + options.ApplicationCookie.AccessDeniedPath = new PathString("/Home/AccessDenied"); + }) .AddEntityFrameworkStores() .AddDefaultTokenProviders(); - services.ConfigureCookieAuthentication(options => - { - options.AccessDeniedPath = new PathString("/Home/AccessDenied"); - }); + services.AddCookieAuthentication(); - services.ConfigureFacebookAuthentication(options => + services.AddFacebookAuthentication(options => { options.AppId = "[AppId]"; options.AppSecret = "[AppSecret]"; @@ -94,7 +94,7 @@ namespace MusicStore options.Scope.Add("user_checkins"); }); - services.ConfigureGoogleAuthentication(options => + services.AddGoogleAuthentication(options => { options.ClientId = "[ClientId]"; options.ClientSecret = "[ClientSecret]";