JWT Tokens Validation

JWT Tokens Validation



How to validate the JWT tokens returned by OATH SSO Server. i have tried with https://www.outsystems.com/forge/component/1853/jwt/ but it has implementation of creating the tokens not read and validate. Kindly suggest us how to achieve this.

Thanks and Regards

Rajashekar Reddy Ette

Hi Rajashekar

I don't think you have at the moment an extention for it, you can allways download that extention and complete it.

Here is a snippet to Serialize the JWT Token to JSON 

var jwtHandler = new JwtSecurityTokenHandler();             var jwtInput = ssToken;             ssResultMessage = "";               var readableToken = jwtHandler.CanReadToken(ssToken);             if (!readableToken)             {                 ssResultMessage = "";             }      else             {                 var jwtJson = "{"+"\"Header"+"\":";                 var token = jwtHandler.ReadJwtToken(jwtInput);                 jwtJson += token.Header.SerializeToJson();                 jwtJson += ","+"\"Payload" + "\":";                 jwtJson += token.Payload.SerializeToJson();                 jwtJson += "}";                 ssResultMessage = jwtJson;             }

This snipet only reads the JWT content and not the signature, and you would also have to create a method to Validate it 

And here you have documentation to help you build it: https://jwt.io/

-Luis Almeida