mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
08.03.2011 95e73eb3bdab96363e6bd01c48203336782f6a5e
Issue OPENDJ-262: Implement pass through authentication (PTA)

Add remaining I18n messages for LDAP connection factory implementation.
2 files modified
51 ■■■■ changed files
opends/src/messages/messages/extension.properties 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 39 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/extension.properties
@@ -1486,3 +1486,15 @@
MILD_ERR_LDAP_PTA_CONNECTION_BIND_FAILED_602=The remote LDAP server at %s:%d \
 for LDAP PTA policy "%s" has failed to authenticate user "%s", returning the \
 response code %d (%s) and error message "%s"
MILD_ERR_LDAP_PTA_CONNECTION_SEARCH_SIZE_LIMIT_603=The remote LDAP server at %s:%d \
 for LDAP PTA policy "%s" returned multiple matching entries while searching \
 "%s" using the filter "%s"
MILD_ERR_LDAP_PTA_CONNECTION_SEARCH_TIME_LIMIT_604=The remote LDAP server at %s:%d \
 for LDAP PTA policy "%s" failed to return any matching entries within the timeout \
 while  searching "%s" using the filter "%s"
MILD_ERR_LDAP_PTA_CONNECTION_SEARCH_NO_MATCHES_605=The remote LDAP server at %s:%d \
 for LDAP PTA policy "%s" did not return any matching entries while searching \
 "%s" using the filter "%s"
MILD_ERR_LDAP_PTA_CONNECTION_SEARCH_FAILED_606=The remote LDAP server at %s:%d \
 for LDAP PTA policy "%s" returned an error while searching "%s" using the \
 filter "%s": response code %d (%s) and error message "%s"
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -316,8 +316,8 @@
            break;
          case OP_TYPE_SEARCH_RESULT_REFERENCE:
            // Count this as a result.
            resultCount++;
            // The reference does not necessarily mean that there would have
            // been any matching results, so lets ignore it.
            break;
          case OP_TYPE_SEARCH_RESULT_DONE:
@@ -334,19 +334,28 @@
              break;
            case SIZE_LIMIT_EXCEEDED:
              // TODO: Too many entries would have been returned.
              // Multiple matching candidates.
              throw new DirectoryException(
                  ResultCode.CLIENT_SIDE_MORE_RESULTS_TO_RETURN,
                  (Message) null);
                  ERR_LDAP_PTA_CONNECTION_SEARCH_SIZE_LIMIT.get(host, port,
                      String.valueOf(options.dn()), String.valueOf(baseDN),
                      String.valueOf(filter)));
            case TIME_LIMIT_EXCEEDED:
              // FIXME: search timed out.
              // The server timed out the search.
              throw new DirectoryException(ResultCode.CLIENT_SIDE_TIMEOUT,
                  (Message) null);
                  ERR_LDAP_PTA_CONNECTION_SEARCH_TIME_LIMIT.get(host, port,
                      String.valueOf(options.dn()), String.valueOf(baseDN),
                      String.valueOf(filter)));
            default:
              // FIXME: The search failed for some reason.
              throw new DirectoryException(resultCode, (Message) null);
              // The search failed for some reason.
              throw new DirectoryException(resultCode,
                  ERR_LDAP_PTA_CONNECTION_SEARCH_FAILED.get(host, port,
                      String.valueOf(options.dn()), String.valueOf(baseDN),
                      String.valueOf(filter), resultCode.getIntValue(),
                      resultCode.getResultCodeName(),
                      searchResult.getErrorMessage()));
            }
            break;
@@ -361,16 +370,22 @@
        if (resultCount > 1)
        {
          // FIXME: too many matching entries found.
          // Multiple matching candidates.
          throw new DirectoryException(
              ResultCode.CLIENT_SIDE_MORE_RESULTS_TO_RETURN, (Message) null);
              ResultCode.CLIENT_SIDE_MORE_RESULTS_TO_RETURN,
              ERR_LDAP_PTA_CONNECTION_SEARCH_SIZE_LIMIT.get(host, port,
                  String.valueOf(options.dn()), String.valueOf(baseDN),
                  String.valueOf(filter)));
        }
        if (username == null)
        {
          // FIXME: no matching entries found.
          // No matching entries found.
          throw new DirectoryException(
              ResultCode.CLIENT_SIDE_NO_RESULTS_RETURNED, (Message) null);
              ResultCode.CLIENT_SIDE_NO_RESULTS_RETURNED,
              ERR_LDAP_PTA_CONNECTION_SEARCH_NO_MATCHES.get(host, port,
                  String.valueOf(options.dn()), String.valueOf(baseDN),
                  String.valueOf(filter)));
        }
        return username;