prasanna p

prasanna p

  • 1.3k
  • 470
  • 103.4k

how to create jwt token using API key,Secret Key&parameters

Jul 25 2022 1:25 PM

hi Friends,

how to create a jwt token using the following content.It is in node js I need the following code in c# , .net core?


const apiKey = strapikey;
const secretKey = strsecretkey;
const tokenCreationTime = Math.floor(Date.now() / 1000);
const payload = { iss: apiKey, iat: tokenCreationTime };

// GET parameters
const parameters = {
    branch:'STS',
    day:'2022-07-19',
    lastKey:
}
const get_request_args = querystring.stringify(parameters);

//jwt library uses HS256 as default.
const token = jwt.sign(payload, secretKey);


Answers (2)