Skip to content

Commit

Permalink
#128 Added DataProtection to the app services startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherJamesMorris committed Apr 27, 2022
1 parent f6ff2c9 commit 0ac6c15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using Microsoft.AspNetCore.DataProtection;

namespace gpconnect_appointment_checker.Configuration.Infrastructure
{
Expand Down Expand Up @@ -77,6 +78,10 @@ public static IServiceCollection ConfigureApplicationServices(this IServiceColle
services.AddSingleton<IAuthorizationHandler, NotAuthorisedUserHandler>();
services.AddSingleton<IAuthorizationHandler, AuthorisedAndIsAdminUserHandler>();

services.AddDataProtection()
.SetApplicationName("GpConnectAppointmentChecker")
.DisableAutomaticKeyGeneration();

services.AddAntiforgery(options =>
{
options.SuppressXFrameOptionsHeader = true;
Expand All @@ -85,6 +90,7 @@ public static IServiceCollection ConfigureApplicationServices(this IServiceColle
options.Cookie.SameSite = SameSiteMode.None;
});


services.Configure<Sso>(configuration.GetSection("SingleSignOn"));
services.Configure<General>(configuration.GetSection("General"));
services.Configure<Spine>(configuration.GetSection("Spine"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
"applicationUrl": "https://localhost:5001"
},
"Docker": {
"commandName": "Docker",
Expand Down
3 changes: 2 additions & 1 deletion source/gpconnect-appointment-checker/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System.Net.Http.HttpClient": "Warning"
"System.Net.Http.HttpClient": "Warning",
"Microsoft.AspNetCore.DataProtection": "Information"
}
},
"AllowedHosts": "*"
Expand Down

0 comments on commit 0ac6c15

Please sign in to comment.