Class BasicCredentials

    • Constructor Detail

      • BasicCredentials

        public BasicCredentials​(String userId,
                                String password)
        Constructor with credentials.
        Parameters:
        userId - The user ID.
        password - The password.
    • Method Detail

      • getUserId

        public String getUserId()
        Get the user ID.
        Returns:
        The user ID.
      • getPassword

        public String getPassword()
        Get the password.
        Returns:
        The password.
      • parse

        public static BasicCredentials parse​(String input)
        Parse Authorization header for Basic authentication.
        Parameters:
        input - The value of Authorization header. Expected inputs are either "Basic {Base64-Encoded-UserID-and-Password}", or "{Base64-Encoded-UserID-and-Password}".
        Returns:
        Parsed credentials. If input is null is returned.
      • format

        public String format()
        Create a value suitable as the value of Authorization header.
        Returns:
        Authorization header value for Basic authentication.