Index: iknow-api/Program.cs
===================================================================
--- iknow-api/Program.cs	(revision 271178d597db61c1a18da2c7f3c6bd48512e23f0)
+++ iknow-api/Program.cs	(revision 5eb784799acea35b5d5c9141ea54699741bc3d71)
@@ -1,9 +1,35 @@
+using System.Text;
+using iknow_api.Data;
+using iknow_api.Repositories;
+using iknow_api.Services;
+using Microsoft.AspNetCore.Authentication.JwtBearer;
 using Microsoft.EntityFrameworkCore;
-using iknow_api.Core.Data;
-using iknow_api.Services;
-using iknow_api.Repositories;
+using Microsoft.IdentityModel.Tokens;
 
 var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddAuthentication(options =>
+{
+    options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
+    options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
+})
+.AddJwtBearer(options =>
+{
+    options.RequireHttpsMetadata = false; // only for development
+    options.SaveToken = true;
+    options.TokenValidationParameters = new TokenValidationParameters
+    {
+        ValidateIssuer = true,
+        ValidIssuer = "iknow-api",
 
+        ValidateAudience = true,
+        ValidAudience = "iknow-api",
+
+        ValidateLifetime = true,
+
+        ValidateIssuerSigningKey = true,
+        IssuerSigningKey = new SymmetricSecurityKey(
+            Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"]))
+    };
+});
 // Add services to the container.
 builder.Services.AddControllers();
@@ -17,5 +43,5 @@
 builder.Services.AddScoped<IAuthService, AuthService>();
 builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation
-
+builder.Services.AddAuthorization();
 var app = builder.Build();
 
@@ -27,4 +53,5 @@
 
 app.UseHttpsRedirection();
+app.UseAuthentication(); // <-- must come BEFORE UseAuthorization
 app.UseAuthorization();
 app.MapControllers();
