Class BasicAuthCredentials


  • public class BasicAuthCredentials
    extends RequestCredentials
    Basic Authentication credentials.
    • Constructor Detail

      • BasicAuthCredentials

        public BasicAuthCredentials​(javax.servlet.http.HttpServletRequest request,
                                    java.lang.String username,
                                    java.lang.String password)
        Constructor.
        Parameters:
        request - the HTTP request object
        username - the user name
        password - the password
    • Method Detail

      • getUsername

        public java.lang.String getUsername()
        Returns the user name.
        Returns:
        the user name
      • getPassword

        public java.lang.String getPassword()
        Returns the password.
        Returns:
        the password
      • createCredentialsFromRequest

        public static BasicAuthCredentials createCredentialsFromRequest​(javax.servlet.http.HttpServletRequest request)
        Creates a BasicAuthCredentials object if the request has basic auth credentials.
        Parameters:
        request - the HTTP request object
        Returns:
        a BasicAuthCredentials or null if the request does not contain basic auth credentials