added entra upcoming valid algorithm

This commit is contained in:
Oliver Kieselbach
2026-05-20 20:09:10 +02:00
parent 7a05268250
commit e6792aee95
@@ -217,8 +217,9 @@ public class AuthenticationMiddleware : IFunctionsWorkerMiddleware
return matchedKeys.Any() ? matchedKeys : openIdConfig.SigningKeys;
},
// Set algorithm validators to ensure we only accept RS256
ValidAlgorithms = new[] { "RS256" }
// Algorithm whitelist: RS256 today, PS256 for Entra's announced rollout.
// Hard-blocks HS-family and "none" (algorithm-confusion defence).
ValidAlgorithms = new[] { "RS256", "PS256" }
};
var principal = _tokenHandler.ValidateToken(token, validationParameters, out var validatedToken);