Class JwtCookie<V>

java.lang.Object
ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
ch.tocco.nice2.web.core.api.servlet.JwtCookie<V>
Direct Known Subclasses:
InformationCookie, RolesCookie

public abstract class JwtCookie<V> extends AbstractNiceCookie
allows cookies to use JWT to sign their content
  • Constructor Details

    • JwtCookie

      public JwtCookie(V content, String secret, int timeToLive, String originDomain)
  • Method Details

    • getSpecificTokens

      protected List<String> getSpecificTokens(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      getSpecificTokens in class AbstractNiceCookie
    • generateJwt

      protected String generateJwt(V content)
    • setClaims

      protected abstract void setClaims(V content, BiConsumer<String,Object> claimConsumer)
    • shouldBeSecured

      protected boolean shouldBeSecured(jakarta.servlet.http.HttpServletRequest request)
      We make sure that this cookie only applied if the connection is https.
      Specified by:
      shouldBeSecured in class AbstractNiceCookie
      Parameters:
      request - ignored, may be null