Using x-emc-date instead of Date for signature calc
For our implementation, I need to use a "api proxy" between the client and the Atmos server. The proxy, as Date is an optional header per HTTP spec, is not passing the Date header.
As the Atmos API doc says, instead of the Date field one can use x-emc-date. I took the Atmos EsuRestAPI java SDK, and modified it to put x-emc-date instead of Date in all occurrences - signature calc, and values in HTTP header.
When I use x-emc-date with or without our proxy, Atmos returns an error. In the same code, if I replace x-emc-date with Date, everything works fine (not through the proxy).
Has anyone tried x-emc-date instead of Date and has been successfully used the Java bindings for REST APIs?
Below is client code log showing headers being sent, and the error message:
When using x-emc-date, you should sign your request with a blank line where the Date value normally goes. I tested this in the Java API by making the following modification to signRequest:
On my first try this didn't work. When adding the "\n" where the Date value should be, why aren't you adding the rest of what goes after the Date value - "\n" + path.toLowerCase() ?
Suppose we never use "Date" and its value for the signature and always have "x-emc-date", wouldn't the code simply be change from:
JasonCwik
1 Rookie
•
281 Posts
388
0
Posted July 30th, 2012 06:00
When using x-emc-date, you should sign your request with a blank line where the Date value normally goes. I tested this in the Java API by making the following modification to signRequest: