Closed (works as designed)
Project:
Services
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2011 at 14:07 UTC
Updated:
5 Mar 2011 at 15:38 UTC
Hey,
I found that the timestamp in the {services_timestamp_nonce} table all had the maximum integer value (2147483647). After poking around for a bit, I found that this is because the timestamp is displayed in milliseconds, and therefore is too long to be stored in a integer field.
I fixed this by dividing the $timestamp variable of function _services_keyauth_authenticate_call in services_keyauth.inc by 1000 ($timestamp = array_shift($args) / 1000;).
Could this error occur because of a php.ini setting? If so, which one ? :-)
Comments
Comment #1
marcus_w commentedOops, too soon, can't authenticate that way. But I'm unable to find the real time() call, which passes to the argument. Can anyone help me please?
Comment #2
marcus_w commentedWell, one more post.
It seems my Java update is feeding the server with millisecond timestamps. I tried dividing that by 1000, but that resulted in an error because the same nonce was used in 1 second (at least, I think that's it). So, I'm pretty stuck.
It would be better if the timestamp for nonce creation is not directly put through to the services_timestamp_nonce table. So just the php 'seconds' timestamp goes into the table. That way, the 30 second expiry rule can work, while the millisecond nonce creation can also work. You'll just get 2 (or more) nonce strings per timestamp in the table.
Comment #3
marcingy commentedThe table stores unix timestamps which is seconds based, so the issue is that you are passing timestamps in the wrong format.