private boolean checkValidUser( URI requestURI,
				    HTTPHeaders headers,
				    HypertextAccessFile htaccess,
				    String authMethod,
				    //String authUser,
				    //char[] authPassData
				    
				    Map<String,BasicType> additionalSettings,
				    Map<String,BasicType> optionalReturnSettings
				    ) 
	throws IOException,
	       MissingParamException,
	       ConfigurationException {


	// The sent auth type and the AuthType from the htaccess file must be equal!
	// [A user cann authorize using 'Basic' when the file requires 'Digest', ...]
	if( htaccess.getAuthType() != null && !authMethod.equalsIgnoreCase(htaccess.getAuthType()) ) {

	    this.logger.log( Level.INFO,
			     getClass().getName() + ".checkValidUser(...)",
			     "User is not allowed to auth because the sent method is '"+authMethod+"' but the configured htaccess file requires '"+htaccess.getAuthType()+"'."
			     );
		
	    return false;
	}



	File authUserFile = htaccess.getAuthUserFile();
	if( authUserFile == null ) {

	    // Auto use ".htpasswd" as default ???
	    if( this.strictMode ) {

		this.logger.log( Level.WARNING,
				 getClass().getName() + ".checkValidUser(...)",
				 "No AuthUserFile specified in htaccess file. Stopping (strictMode="+strictMode+")."
				 );
		throw new ConfigurationException( "No AuthUserFile specified in htaccess file." );

	    } else {

		this.logger.log( Level.WARNING,
				 getClass().getName() + ".checkValidUser(...)",
				 "No AuthUserFile specified in htaccess file. Ignoring by the use of default '.htpasswd' file (strictMode="+strictMode+")." );
		authUserFile = new File( htaccess.getSourceFile().getParentFile(), ".htpasswd" );

	    }

	}


	// .htpasswd file exists?
	if( !authUserFile.exists() ) {

	    throw new ConfigurationException( "Cannot read AuthUserFile: file not found." );

	}



	// Switch authorization method
	if( authMethod.equalsIgnoreCase("Basic") ) {

	    return checkValidUser_basicAuthentication( requestURI,
						       headers,
						       htaccess,
						       authMethod,

						       authUserFile,

						       additionalSettings,
						       optionalReturnSettings
						       );

	} else if( authMethod.equalsIgnoreCase("Digest") ) {

	    
	    return checkValidUser_digestAuthentication( requestURI,
							headers,
							htaccess,
							authMethod,

							authUserFile,

							additionalSettings,
							optionalReturnSettings
							);

	} else {	    

	    this.logger.log( Level.SEVERE,
			     getClass().getName() + ".checkValidUser(...)",
			     "Oooops, the authentication method \""+authMethod+"\" is not supported. Usually this case should be detected much earlier!" );
	    throw new ConfigurationException( "The authentication method \""+authMethod+"\" is not supported." );
	}
	
    }