Signature verification failed in JWT token

I am new in creating jira plugin. I am trying to create a jwt token to read (and write in future) using rest api. When I connect with jira cloud with the token, I receive 401 (Unauthorized) status code. To check my tokens validity I paste my JWT token at, it parse the the header and claim part without any issue, but it cannot validate the signature part. I wrote the token generator in PHP using FirebaseJWT as follows

use \Firebase\JWT\JWT;

$qsh = hash('sha256', "GET&/rest/api/2/application-properties&");

$token = array (
  'iss' => '',
  'iat' => 1530907762,
  'exp' => 1530911586,
  'qsh' => $qsh,

$jwt = JWT::encode($token, "7pTMUDgs7UGGhLAp0lnyfzs+tz8LNxcQUQW3+U7wI7xXZnL7HgZcIyLkiF1bF1xYVkcO6zFHagUjQZ+mWXmb3Q");

echo $jwt;

The code is straight forward, and I am not sure, where exactly I am making mistake. I am really stuck on this, and I am in desperate need for help. Please let me know how can I fix it.

With thanks

@monjur - this is related to the same problem you ran into before, correct?

Not exactly, i figured the amazon site is broken. So waiting for them to fix it. After that I will retest and will let you know.

Thanks for your attention