Nexial Automation

Test Automation Platform for everyone!

X

ws » jwtSignHS256(var,payload,key)

Description

This command generates JWT Token that can be used further as an Authorization Header in the Web Service Request.

What is JSON Web Token?

JSON Web Token (JWT) is an open standard ( RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA.

Learn More..

Parameters

  • var - this parameter is used to assign the returned value.
  • payload - this parameter is the json payload.
  • key - this parameter is the secret key (digital signature key).

Example

The actual json content is read from the local file and passed as an argument as payload.

Script:

Output:

See Also