Tabnine Logo
TokenExpiredException
Code IndexAdd Tabnine to your IDE (free)

How to use
TokenExpiredException
in
leap.core.security.token

Best Java code snippets using leap.core.security.token.TokenExpiredException (Showing top 3 results out of 315)

origin: org.leapframework/leap-core

protected void verifyTokenExpired(String expires) throws TokenExpiredException {
  long expirationTime = Long.parseLong(expires);
  long now			= System.currentTimeMillis();
  
  if(expirationTime > 0 && now - expirationTime > 0) {
    throw new TokenExpiredException("Token expired, expration time '" + expirationTime + "', current time '" + now + "'");
  }
}

origin: org.leapframework/leap-websecurity

@Override
public boolean verifyToken(Request request, String token, CsrfToken expected) throws CsrfTokenExpiredException {
  try {
    return null == token ? false : tokenEncoder.verifyToken(token);
  } catch (TokenExpiredException e) {
    throw new CsrfTokenExpiredException(e.getMessage());
  }
}
origin: org.leapframework/leap-core

protected void verifyExpiration(Map<String, Object> claims) {
  Object exp = claims.get(JWT.CLAIM_EXPIRATION_TIME);
  if (null != exp && exp instanceof Number) {
    long expirationTimeSecond = ((Number) exp).longValue();
    long nowTimeInSecond = System.currentTimeMillis()/1000L;
    if(expirationTimeSecond <= 0 || nowTimeInSecond >= expirationTimeSecond){
      throw new TokenExpiredException("Token expired");
    }
  }
}
leap.core.security.tokenTokenExpiredException

Most used methods

  • <init>
  • getMessage

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Collectors (java.util.stream)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Option (scala)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now