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.
- <?php
- $secretKey = 'ghHqUPZ5BjuqeJvLazfV0KbyWD3WZ0r9hAYrPbf6'; //'bGS6lzFqvvSQ8ALbOxatm7/Vk7mLQyzqaS34Q4oR1ew=';
- $issuedAt = new DateTimeImmutable();
- $expire = $issuedAt->modify('+6 minutes')->getTimestamp(); // Add 60 seconds
- $serverName = "your.domain.name";
- $username = "username";
- $data = [
- 'iat' => $issuedAt->getTimestamp(), // Issued at: time when the token was generated
- 'iss' => $serverName, // Issuer
- 'nbf' => $issuedAt->getTimestamp(), // Not before
- 'exp' => $expire, // Expire
- 'userName' => $username, // User name
- ];
- include 'JWT.php';
- use Firebase\JWT\JWT;
- $jwt = JWT::encode(
- $data,
- $secretKey,
- 'HS512'
- );
- return $jwt;
- ?>
Thank you,
Slava