Package org.silverpeas.core.web.rs
Enum AuthenticationScheme
- java.lang.Object
-
- java.lang.Enum<AuthenticationScheme>
-
- org.silverpeas.core.web.rs.AuthenticationScheme
-
- All Implemented Interfaces:
Serializable
,Comparable<AuthenticationScheme>
public enum AuthenticationScheme extends Enum<AuthenticationScheme>
The different HTTP authentication schemes supported by Silverpeas.- Author:
- mmoquillon
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BASIC
The basic authentication expects the user credentials to be passed in a base 64 encoded string.BEARER
The Bearer authentication scheme was defined first for the OAuth authentication mechanism (IETF RFC 6750) and it is now used by any other token-based authentication or authorization mechanisms like the JSON Web Token (JWT, IETF RFC 7797).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<AuthenticationScheme>
from(String scheme)
Gets anAuthenticationScheme
from the specified keyword identifying a particular HTTP authentication scheme.static AuthenticationScheme
valueOf(String name)
Returns the enum constant of this type with the specified name.static AuthenticationScheme[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BASIC
public static final AuthenticationScheme BASIC
The basic authentication expects the user credentials to be passed in a base 64 encoded string. This string must contain both the user identifier and its password separated by a single colon character. It is the default HTTP authentication scheme.
-
BEARER
public static final AuthenticationScheme BEARER
The Bearer authentication scheme was defined first for the OAuth authentication mechanism (IETF RFC 6750) and it is now used by any other token-based authentication or authorization mechanisms like the JSON Web Token (JWT, IETF RFC 7797).In this scheme, the token must be a string that must satisfy the following grammar: ( ALPHA | DIGIT | "-" | "." | "_" | "~" | "+" | "/" )+ "="*
-
-
Method Detail
-
values
public static AuthenticationScheme[] 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 (AuthenticationScheme c : AuthenticationScheme.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AuthenticationScheme 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
-
from
public static Optional<AuthenticationScheme> from(String scheme)
Gets anAuthenticationScheme
from the specified keyword identifying a particular HTTP authentication scheme.- Parameters:
scheme
- a string containing an HTTP Authentication scheme.- Returns:
- an optional
AuthenticationScheme
instance matching the specified scheme. If the given scheme isn't supported by Silverpeas, then nothing is returned (the optional is empty).
-
-