How do I deserialize timestamps that are in seconds with Jackson?

I wrote a custom deserializer to handle timestamps in seconds (Groovy syntax). class UnixTimestampDeserializer extends JsonDeserializer<DateTime> { Logger logger = LoggerFactory.getLogger(UnixTimestampDeserializer.class) @Override DateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { String timestamp = jp.getText().trim() try { return new DateTime(Long.valueOf(timestamp + ‘000’)) } catch (NumberFormatException e) { logger.warn(‘Unable to deserialize timestamp: ‘ + timestamp, e) …

Read more

What’s the point of a timestamp in OAuth if a Nonce can only be used one time?

The timestamp is used for allowing the server to optimize their storage of nonces. Basically, consider the read nonce to be the combination of the timestamp and random string. But by having a separate timestamp component, the server can implement a time-based restriction using a short window (say, 15 minutes) and limit the amount of …

Read more