I have a problem using JWT tokens as validation. The problem is that the flow calls the function JwtSecurityTokenHandler.ReadOnlyCollection ValidateToken(SecurityToken token). Which is obsolete and it tells me to use the function JwtSecurityTokenHandler.ClaimsPrincipal ValidateToken(string securityToken, TokenValidationParameters validationParameters, out SecurityToken validatedToken). But how do i do this?
My web.config is configured in this way.
<system.identityModel>
<identityConfiguration saveBootstrapContext="true">
<audienceUris>
<add value="urn:xyz" />
</audienceUris>
<securityTokenHandlers>
<add type="System.IdentityModel.Tokens.JwtSecurityTokenHandler, System.IdentityModel.Tokens.Jwt, Version=4.0.0.0" />
<securityTokenHandlerConfiguration>
<certificateValidation certificateValidationMode="PeerTrust" />
</securityTokenHandlerConfiguration>
</securityTokenHandlers>
<issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<trustedIssuers>
<add name="XXX" thumbprint="[NNN]" />
</trustedIssuers>
</issuerNameRegistry>
<issuerTokenResolver type="System.IdentityModel.Tokens.NamedKeyIssuerTokenResolver, System.IdentityModel.Tokens.Jwt, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</identityConfiguration>
</system.identityModel>
<system.identityModel.services>
<federationConfiguration>
<wsFederation passiveRedirectEnabled="true" issuer="https://xxx/issue/wsfed" realm="urn:xyz" requireHttps="true" />
</federationConfiguration>
</system.identityModel.services>