I am currently storing my access token in a string
String token = getAccessToken();
conn.setRequestProperty ("Authorization", "Bearer " + token);
I am testing a piece of code that creates million of users. Each time when I make a post call, I need to set authorization, the authorization obtained once are valid for 1 hour.
Is there a way I can store this token for 1 hour and only when I get authorization exception, I again make a call to get the token stored back to the string.
Currently I am making this call prior to a get/post call to search and create user.