From 66bd53a39f9cbc008681bf56c918ecf620eb269a Mon Sep 17 00:00:00 2001 From: Corey Date: Mon, 18 Jan 2021 09:15:33 +0000 Subject: [PATCH] [CON-2991] Pass application name into shared extnsion for Redis Data Protection --- src/Employer/Employer.Web/Startup.ConfigureServices.cs | 2 +- src/Provider/Provider.Web/Startup.ConfigureServices.cs | 2 +- src/QA/QA.Web/Startup.ConfigureServices.cs | 2 +- .../Extensions/DataProtectionStartupExtensions.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Employer/Employer.Web/Startup.ConfigureServices.cs b/src/Employer/Employer.Web/Startup.ConfigureServices.cs index b91560aef3..e1665366b8 100644 --- a/src/Employer/Employer.Web/Startup.ConfigureServices.cs +++ b/src/Employer/Employer.Web/Startup.ConfigureServices.cs @@ -60,7 +60,7 @@ public void ConfigureServices(IServiceCollection services) services.AddAuthorizationService(); } - services.AddDataProtection(_configuration, _hostingEnvironment); + services.AddDataProtection(_configuration, _hostingEnvironment, applicationName: "das-employer-recruit-web"); } } } diff --git a/src/Provider/Provider.Web/Startup.ConfigureServices.cs b/src/Provider/Provider.Web/Startup.ConfigureServices.cs index f13fc5fe06..7608ce2419 100644 --- a/src/Provider/Provider.Web/Startup.ConfigureServices.cs +++ b/src/Provider/Provider.Web/Startup.ConfigureServices.cs @@ -44,7 +44,7 @@ public void ConfigureServices(IServiceCollection services) }); services.AddMvcService(_hostingEnvironment, _loggerFactory); - services.AddDataProtection(_configuration, _hostingEnvironment); + services.AddDataProtection(_configuration, _hostingEnvironment, applicationName: "das-provider-recruit-web"); services.AddApplicationInsightsTelemetry(_configuration); diff --git a/src/QA/QA.Web/Startup.ConfigureServices.cs b/src/QA/QA.Web/Startup.ConfigureServices.cs index 4f9603d462..9bd44903d2 100644 --- a/src/QA/QA.Web/Startup.ConfigureServices.cs +++ b/src/QA/QA.Web/Startup.ConfigureServices.cs @@ -58,7 +58,7 @@ public void ConfigureServices(IServiceCollection services) }); services.AddMvcService(_loggerFactory); - services.AddDataProtection(_configuration, _hostingEnvironment); + services.AddDataProtection(_configuration, _hostingEnvironment, applicationName: "das-qa-recruit-web"); services.AddAntiforgery( options => diff --git a/src/Shared/Recruit.Shared.Web/Extensions/DataProtectionStartupExtensions.cs b/src/Shared/Recruit.Shared.Web/Extensions/DataProtectionStartupExtensions.cs index a3efed6dba..0a81bce6e8 100644 --- a/src/Shared/Recruit.Shared.Web/Extensions/DataProtectionStartupExtensions.cs +++ b/src/Shared/Recruit.Shared.Web/Extensions/DataProtectionStartupExtensions.cs @@ -9,7 +9,7 @@ namespace Esfa.Recruit.Shared.Web.Extensions { public static class DataProtectionStartupExtensions { - public static IServiceCollection AddDataProtection(this IServiceCollection services, IConfiguration configuration, IHostingEnvironment environment) + public static IServiceCollection AddDataProtection(this IServiceCollection services, IConfiguration configuration, IHostingEnvironment environment, string applicationName) { if (!environment.IsDevelopment()) { @@ -25,7 +25,7 @@ public static IServiceCollection AddDataProtection(this IServiceCollection servi .Connect($"{redisConnectionString},{dataProtectionKeysDatabase}"); services.AddDataProtection() - .SetApplicationName("das-employer-recruit") + .SetApplicationName(applicationName) .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); } }