CyberSource/cybersource-rest-samples-java

Date Format in HTTP Signature

gsbrown7 opened this issue · 1 comments

Hello!
I seem to be having an issue with "StandaloneHttpSignature" where the date being used in the algorithm is a single digit date like "Wed, 4 Mar 2020 22:53:40 GMT" and I'm getting "Authentication Failed" errors. If I force the value to "Wed, 04 Mar 2020 22:53:40 GMT", then it works.

Is there something I can do with this formatting code to make it use a 2-digit day? I'm using Java 1.8
return(DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.now(ZoneId.of("GMT"))));

After further testing using "Wed, 4 Mar 2020 22:53:40 GMT" in Windows Postman, it's working successfully there. So I don't think "4" vs ."04" date is my issue.