(JAVA) Timeout for random token

1

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?

    
asked by anonymous 04.07.2018 / 00:43

0 answers