Exemple #1
0
 void setToken(AuthRequest req, TokenInfo info) {
   tokenStore.set(req.asString(), info.asString());
 }
Exemple #2
0
 /*
  * @param req The authentication request of which to request the expiration
  *        status.
  * @return The number of milliseconds until the token expires, or negative
  *         infinity if no token was found.
  */
 public double expiresIn(AuthRequest req) {
   String val = tokenStore.get(req.asString());
   return val == null
       ? Double.NEGATIVE_INFINITY
       : Double.valueOf(TokenInfo.fromString(val).expires) - clock.now();
 }
Exemple #3
0
 TokenInfo getToken(AuthRequest req) {
   String tokenStr = tokenStore.get(req.asString());
   return tokenStr != null ? TokenInfo.fromString(tokenStr) : null;
 }