Skip to content

Commit

Permalink
[CON-2991] Pass application name into shared extnsion for Redis Data …
Browse files Browse the repository at this point in the history
…Protection
  • Loading branch information
cofaulco committed Jan 18, 2021
1 parent 467d2b3 commit 66bd53a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Employer/Employer.Web/Startup.ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddAuthorizationService();
}

services.AddDataProtection(_configuration, _hostingEnvironment);
services.AddDataProtection(_configuration, _hostingEnvironment, applicationName: "das-employer-recruit-web");
}
}
}
2 changes: 1 addition & 1 deletion src/Provider/Provider.Web/Startup.ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/QA/QA.Web/Startup.ConfigureServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -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");
}
}
Expand Down

0 comments on commit 66bd53a

Please sign in to comment.