ref site : http://www.decatechlabs.com/secure-webapi-using-jwt Step 1 : Step 2 : Step 3 : Step 4 : Now replace all code with below code using Microsoft . IdentityModel . Tokens ; using System ; using System . Collections . Generic ; using System . IdentityModel . Tokens ; using System . IdentityModel . Tokens . Jwt ; using System . IO ; using System . Linq ; using System . Net ; using System . Net . Http ; using System . Security . Cryptography . X509Certificates ; using System . Threading ; using System . Threading . Tasks ; using System . Web ; namespace WEBAPI_JWT_Authentication { internal class TokenValidationHandler : DelegatingHandler { private static bool TryRetrieveToken ...
Comments
Post a Comment