Skip to content

Commit a1a816f

Browse files
committed
policy not working
1 parent 84bc4b5 commit a1a816f

File tree

4 files changed

+3
-33
lines changed

4 files changed

+3
-33
lines changed

src/Api/Product.db

0 Bytes
Binary file not shown.

src/Api/Xero.Demo.Domain/Models/AuthenticateRequest.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Api/Xero.Demo.Infrastructure/Extensions/AddAuthorizationExtension.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
using Microsoft.AspNetCore.Authentication.JwtBearer;
2-
using Microsoft.AspNetCore.Http;
3-
using Microsoft.AspNetCore.Mvc;
4-
using Microsoft.AspNetCore.Mvc.Filters;
52
using Microsoft.Extensions.Configuration;
63
using Microsoft.Extensions.DependencyInjection;
74
using Microsoft.IdentityModel.Tokens;
85
using System;
9-
using System.Security.Claims;
106
using System.Text;
11-
using Xero.Demo.Api.Domain.Security;
12-
using Xero.Demo.Api.Xero.Demo.Domain.Models;
137
using Xero.Demo.Api.Xero.Demo.Domain.Services;
14-
using static Xero.Demo.Api.Domain.Models.CONSTANTS;
158

169
namespace Xero.Demo.Api.Domain.Infrastructure
1710
{
18-
public static partial class AddAuthorizationExtension
11+
public static partial class AddSecurityExtension
1912
{
20-
public static IServiceCollection AddSecurity(this IServiceCollection services)
21-
{
22-
return services;
23-
}
24-
25-
public static IServiceCollection AddJwtAuthentication(this IServiceCollection services, IConfiguration configuration)
13+
public static IServiceCollection AddSecurity(this IServiceCollection services, IConfiguration configuration)
2614
{
2715
services.AddScoped<IUserService, UserService>();
2816

src/Api/Xero.Demo.Infrastructure/Extensions/AddMiddleWareExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public static void AddServices(this IServiceCollection services, IConfiguration
2020
{
2121
services.AddControllers();
2222
services.Configure<JwtSettings>(Configuration.GetSection("JwtSettings"));
23-
services.AddJwtAuthentication(Configuration);
24-
services.AddSecurity();
23+
services.AddSecurity(Configuration);
2524
services.AddDbContext<Database>(options =>
2625
{
2726
options.UseSqlite(Configuration.GetConnectionString(CONSTANTS.SqlLite))

0 commit comments

Comments
 (0)