From 651c810496bf26f784f2fbcf48c9e0b7f9f8766d Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 13 Aug 2023 20:58:44 -0400 Subject: [PATCH] Fix issue with token claim mapping --- src/Tgstation.Server.Host/Core/Application.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index 591953c0d8..5718d2cd1d 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.IdentityModel.Tokens.Jwt; using System.Linq; using Cyberboss.AspNetCore.AsyncInitializer; @@ -224,6 +223,7 @@ namespace Tgstation.Server.Host.Core // this line isn't actually run until the first request is made // at that point tokenFactory will be populated jwtBearerOptions.TokenValidationParameters = tokenFactory.ValidationParameters; + jwtBearerOptions.MapInboundClaims = false; jwtBearerOptions.Events = new JwtBearerEvents { // Application is our composition root so this monstrosity of a line is okay @@ -238,11 +238,6 @@ namespace Tgstation.Server.Host.Core }; }); - // WARNING: STATIC CODE - // fucking prevents converting 'sub' to M$ bs - // can't be done in the above lambda, that's too late - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); - // add mvc, configure the json serializer settings services .AddMvc(options =>