Package org.refcodes.net
Enum TokenType
- java.lang.Object
-
- java.lang.Enum<TokenType>
-
- org.refcodes.net.TokenType
-
- All Implemented Interfaces:
Serializable
,Comparable<TokenType>
public enum TokenType extends Enum<TokenType>
The Enum TokenType.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description 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).MAC
Use MAC Tokens in HTTP requests to access OAuth 2.0 protected resources.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TokenType
fromName(String aName)
Returns thatTokenType
represented by the given name.String
getName()
Gets the name.static TokenType
valueOf(String name)
Returns the enum constant of this type with the specified name.static TokenType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 thisTokenType
in an HTTP-HeaderHeaderField.TOKEN_TYPE
in case you want to use theBEARER
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 message digest function to the request. See also "https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05" Provide thisTokenType
in an HTTP-HeaderHeaderField.TOKEN_TYPE
in case you want to use theMAC
token type.
-
-
Method Detail
-
values
public static TokenType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TokenType c : TokenType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TokenType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
public String getName()
Gets the name.- Returns:
- the name
-
-