mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 05:56:58 +01:00
Fix issue with token claim mapping
This commit is contained in:
@@ -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 =>
|
||||
|
||||
Reference in New Issue
Block a user