CyberSource / CyberSource/cybersource-rest-client-php

Incorrect time string when system timezone is not GMT

Open
#171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
41
Forks
77
Avg merge
26m
Merged PRs (30d)
1

Description

https://github.com/CyberSource/cybersource-rest-client-php/blob/a9ddad7807068cd9b84caaca6345dc1387c8a54c/lib/Authentication/Jwt/JsonWebTokenGenerator.php#L31

When system time zone is not GMT, this line will return the local time string and attach a GMT suffix behind. API call will fail with "UNAUTHORIZED_USER" because of the "iat" field in JWT payload different from current time too much.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/Authentication/Jwt/JsonWebTokenGenerator.php line 31 and inspect how the JWT iat value is formatted. Verify the generated timestamp is independent of the system timezone and compare it with the current GMT time; done means API authentication no longer fails with UNAUTHORIZED_USER on non-GMT systems.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.