Enum Class TokenType

java.lang.Object
java.lang.Enum<TokenType>
org.refcodes.web.TokenType
All Implemented Interfaces:
Serializable, Comparable<TokenType>, Constable

public enum TokenType extends Enum<TokenType>
The Enum TokenType.
  • Enum Constant Details

    • BEARER

      public static final TokenType BEARER
      Any party in possession of a bearer token (a "bearer") can use it to get access to the associated resources (without demonstrating possession of a cryptographic key). To prevent misuse, bearer tokens need to be protected from disclosure in storage and in transport. Provide this TokenType in an HTTP-Header HeaderField.TOKEN_TYPE in case you want to use the BEARER token type. See also "https://tools.ietf.org/html/rfc6750"
    • MAC

      public static final TokenType MAC
      Use MAC Tokens in HTTP requests to access OAuth 2.0 protected resources. An OAuth client willing to access a protected resource needs to demonstrate possession of a cryptographic key by using it with a keyed aMessage digest function to the request. See also "https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05" Provide this TokenType in an HTTP-Header HeaderField.TOKEN_TYPE in case you want to use the MAC token type.
  • Method Details

    • values

      public static TokenType[] 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 TokenType 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
    • getName

      public String getName()
      Gets the name.
      Returns:
      the name
    • fromName

      public static TokenType fromName(String aName)
      Returns that TokenType represented by the given name.
      Parameters:
      aName - The name for which to determine the TokenType.
      Returns:
      The determined TokenType or null if none was determinable.