Enum Class AuthCookiePrefix

java.lang.Object
java.lang.Enum<AuthCookiePrefix>
eu.webtoolkit.jwt.auth.AuthCookiePrefix
All Implemented Interfaces:
Serializable, Comparable<AuthCookiePrefix>, Constable

public enum AuthCookiePrefix extends Enum<AuthCookiePrefix>
Enumeration that describes the possible auth cookie prefix.

Cookie prefixes are prefix that are added to the cookies name to enforce some rules on it. This allows to prevent some attacks where the attacker would try to update the cookies attribute.

See Also:
  • Enum Constant Details

    • Empty

      public static final AuthCookiePrefix Empty
      No prefix.
    • Secure

      public static final AuthCookiePrefix Secure
      __Secure- prefix

      This prefix ensure that the cookies has the Secure attribute set and ensure that the cookie is set by an HTTPS page.

      This requires that the request was made over HTTPS.

    • Host

      public static final AuthCookiePrefix Host
      __Host- prefix

      This prefix adds the same restriction as the __Secure- prefix with the addition that the cookie can only be sent to the host subdomain or domain that set it. It also enforces that the Domain atrribute is not set, and that the Path attribute is set to "/".

      See Also:
    • Auto

      public static final AuthCookiePrefix Auto
      Automatically choose the prefix.
  • Method Details

    • values

      public static AuthCookiePrefix[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AuthCookiePrefix valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Returns the numerical representation of this enum.