See this answer: https://stackoverflow.com/a/78650835/19375103
just install Microsoft.IdentityModel.Protocols.OpenIdConnect corresponding to the version of Microsoft.AspNetCore.Authentication.OpenIdConnect
And enable .UseSecurityTokenValidators = true