-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump dotnet to 8, bump all of the dependencies to matching version. Migrate from "System.IdentityModel.Tokens.Jwt" to "Microsoft.IdentityModel.JsonWebTokens" as it is now the recomended approach. Remove dead code, as agreed We will not be doing any maping of Keycloak id in our db.
- Loading branch information
1 parent
a383ccc
commit d3b156a
Showing
13 changed files
with
34 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
backend/src/api/Migrations/20240223084836_Init.Designer.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.IdentityModel.JsonWebTokens; | ||
|
||
namespace api; | ||
|
||
public static class RequestExtensions | ||
{ | ||
public static string? UserId(this HttpRequest request) | ||
{ | ||
try | ||
{ | ||
var accessToken = request.Headers.Authorization.ToString().Split(' ')[1]; | ||
var jsonTokenData = new JsonWebTokenHandler().ReadJsonWebToken(accessToken); | ||
return jsonTokenData.Subject; | ||
} | ||
catch | ||
{ | ||
return null; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<UserSecretsId>f7cb2e8e-61a4-4a0a-9259-839230fcfe2d</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.2" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2"> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.3" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.3"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" /> | ||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.1" /> | ||
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" /> | ||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" /> | ||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> | ||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.34.0" /> | ||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Migrations/" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters