{"record":{"id":"e0f8c09cc1083e8b","repo":"apache/hadoop","slug":"either-ldap-base-dn-or-ldap-domain-value-needs-to","errorCode":null,"errorMessage":"Either LDAP base DN or LDAP domain value needs to be specified","messagePattern":"Either LDAP base DN or LDAP domain value needs to be specified","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/LdapAuthenticationHandler.java","lineNumber":151,"sourceCode":"  @Override\n  public String getType() {\n    return TYPE;\n  }\n\n  @Override\n  public void init(Properties config) throws ServletException {\n    this.baseDN = config.getProperty(BASE_DN);\n    this.providerUrl = config.getProperty(PROVIDER_URL);\n    this.ldapDomain = config.getProperty(LDAP_BIND_DOMAIN);\n    this.enableStartTls =\n        Boolean.valueOf(config.getProperty(ENABLE_START_TLS, \"false\"));\n\n    if (this.providerUrl == null) {\n      throw new NullPointerException(\"The LDAP URI can not be null\");\n    }\n    if (!((this.baseDN == null)\n        ^ (this.ldapDomain == null))) {\n      throw new IllegalArgumentException(\n          \"Either LDAP base DN or LDAP domain value needs to be specified\");\n    }\n    if (this.enableStartTls) {\n      String tmp = this.providerUrl.toLowerCase();\n      if (tmp.startsWith(\"ldaps\")) {\n        throw new IllegalArgumentException(\n            \"Can not use ldaps and StartTLS option at the same time\");\n      }\n    }\n  }\n\n  @Override\n  public void destroy() {\n  }\n\n  @Override\n  public boolean managementOperation(AuthenticationToken token,\n      HttpServletRequest request, HttpServletResponse response)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/LdapAuthenticationHandler.java#L133-L169","documentation":"Thrown from LdapAuthenticationHandler.init when exactly one of base DN and LDAP bind domain is set: the XOR check requires precisely one of the two to locate users (either search by DN or construct user@domain names). Fires when both or neither are configured.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["Specify either the LDAP base DN or the LDAP domain in the handler configuration."],"exampleFix":"Set init-param ldap.basedn=dc=example,dc=com.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}