|
Last change
on this file since 4f5d8fd was 5eb7847, checked in by stefansaveski <stefansaveski19@…>, 11 months ago |
|
Add JWT authentication and refactor namespaces
Introduced JWT-based authentication and authorization:
- Configured JWT authentication in
Program.cs with token validation.
- Added
[Authorize] attribute to a new getstring endpoint.
Refactored namespaces for consistency:
- Updated namespaces from
iknow_api.Core.* to iknow_api.*.
Enhanced middleware and dependency injection:
- Registered
IAuthService and IUserRepository.
- Added
app.UseAuthentication() and app.UseAuthorization().
Removed unused code and dependencies:
- Deleted
WeatherForecast class.
- Cleaned up redundant imports.
Updated project dependencies to include JWT authentication library.
|
-
Property mode
set to
100644
|
|
File size:
957 bytes
|
| Line | |
|---|
| 1 | <Project Sdk="Microsoft.NET.Sdk.Web">
|
|---|
| 2 |
|
|---|
| 3 | <PropertyGroup>
|
|---|
| 4 | <TargetFramework>net9.0</TargetFramework>
|
|---|
| 5 | <Nullable>enable</Nullable>
|
|---|
| 6 | <ImplicitUsings>enable</ImplicitUsings>
|
|---|
| 7 | <RootNamespace>iknow_api</RootNamespace>
|
|---|
| 8 | </PropertyGroup>
|
|---|
| 9 |
|
|---|
| 10 | <ItemGroup>
|
|---|
| 11 | <PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
|---|
| 12 | <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.10" />
|
|---|
| 13 | <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
|
|---|
| 14 | <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10">
|
|---|
| 15 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|---|
| 16 | <PrivateAssets>all</PrivateAssets>
|
|---|
| 17 | </PackageReference>
|
|---|
| 18 | <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
|---|
| 19 | <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
|
|---|
| 20 | </ItemGroup>
|
|---|
| 21 |
|
|---|
| 22 | </Project>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.