code: func Authenticate(config *Config, username, password string) (bool, error) {
  	upn, err := config.UPN(username)
  	if err != nil {
  		return false, err
  	}
  
  	conn, err := config.Connect()
  	if err != nil {
  		return false, err
  	}
  	defer conn.Conn.Close()
  
  	return conn.Bind(upn, password)
  }
docs: //Authenticate checks if the given credentials are valid, or returns an error if one occurred.
  //username may be either the sAMAccountName or the userPrincipalName.