Skip to content

Commit

Permalink
Fix issue with token claim mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Aug 14, 2023
1 parent 2fa35a4 commit 651c810
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Tgstation.Server.Host/Core/Application.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -224,6 +223,7 @@ public void ConfigureServices(
// 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
Expand All @@ -238,11 +238,6 @@ public void ConfigureServices(
};
});

// 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 =>
Expand Down

0 comments on commit 651c810

Please sign in to comment.