Enum AuthenticationScheme

    • 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 name
        NullPointerException - if the argument is null
      • from

        public static Optional<AuthenticationScheme> from​(String scheme)
        Gets an AuthenticationScheme 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).