Skip to content

Commit 1a75ee0

Browse files
committed
Update Startup.cs
Authentication added
1 parent 45d34e5 commit 1a75ee0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Supermarket/Startup.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Microsoft.Extensions.DependencyInjection;
77
using Newtonsoft.Json.Serialization;
88
using Supermarket.Extensions;
9-
using Swashbuckle.AspNetCore.Swagger;
9+
using Supermarket.Resources;
1010

1111
namespace Supermarket
1212
{
@@ -22,12 +22,22 @@ public Startup(IConfiguration configuration)
2222
// This method gets called by the runtime. Use this method to add services to the container.
2323
public void ConfigureServices(IServiceCollection services)
2424
{
25+
26+
//inject AppSettings
27+
services.Configure<ApplicationSettings>(Configuration.GetSection("ApplicationSettings"));
28+
2529
services.ConfigureCors();
2630

2731
services.ConfigureIISIntegration();
2832

2933
services.ConfigureMSSQLContext(Configuration);
3034

35+
services.ConfigureIdentity();
36+
37+
services.ConfigurePasswordPolicy();
38+
39+
services.ConfigureAuthentication(Configuration);
40+
3141
services.ConfigureRepositoryWrapper();
3242

3343
services.ConfigureServicesWrapper();
@@ -55,6 +65,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
5565
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
5666
app.UseHsts();
5767
}
68+
app.UseAuthentication();
5869

5970
app.UseHttpsRedirection();
6071

0 commit comments

Comments
 (0)