How to debug ASAP add-on with JWT

How to debug ASAP add-on with JWT

Hello,

I'm creating ASAP add-on with JWT authentication. I'm putting screenshots of my settings page and code of JWT endpoint for your review. My question is how can I see and ensure that plug-in works? What should I see? How can I debug JWT communication? I'm going to https://webtestacc.blogspot.com url and don't see anything.

  1. <?php

  2. $secretKey  = 'ghHqUPZ5BjuqeJvLazfV0KbyWD3WZ0r9hAYrPbf6';  //'bGS6lzFqvvSQ8ALbOxatm7/Vk7mLQyzqaS34Q4oR1ew=';
  3. $issuedAt   = new DateTimeImmutable();
  4. $expire     = $issuedAt->modify('+6 minutes')->getTimestamp();      // Add 60 seconds
  5. $serverName = "your.domain.name";
  6. $username   = "username";

  7. $data = [
  8.     'iat'  => $issuedAt->getTimestamp(),         // Issued at: time when the token was generated
  9.     'iss'  => $serverName,                       // Issuer
  10.     'nbf'  => $issuedAt->getTimestamp(),         // Not before
  11.     'exp'  => $expire,                           // Expire
  12.     'userName' => $username,                     // User name
  13. ];

  14. include 'JWT.php';
  15. use Firebase\JWT\JWT;

  16. $jwt = JWT::encode(
  17.     $data,
  18.     $secretKey,
  19.     'HS512'
  20. );

  21. return $jwt;

  22. ?>

Thank you,
Slava