I'm generating an alphanumeric token like this:
SecureRandom secureRandom = new SecureRandom();
long longToken = Math.abs(secureRandom.nextLong());
String random = Long.toString(longToken, 16);
I need a mechanism that defines the lifetime of this token, so that it is not used more than once (Example: Something in the sense of JWT timeout). Does anyone have any idea how to do this?