Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-1062

Google Apps Connector: Equals Filter

    Details

      Description

      In the 1.4.4.0 Google connector, there are some missing parenthesis which result in equals queries for anything other than name or alias to fail because the system tries to do a read instead of a query.

      Example: /givenName eq "John" results in a read request for John which fails.

      The missing parenthesis are in GoogleAppsConnector.java in the getKeyFromFilter function

      else if (ObjectClass.ACCOUNT.equals(objectClass) || ObjectClass.GROUP.equals(objectClass) && (filterAttr instanceof Name || filterAttr.getName().equalsIgnoreCase(ALIASES_ATTR))) {

      There should be parenthesis around the objectClass checks as follows:

      else if ((ObjectClass.ACCOUNT.equals(objectClass) || ObjectClass.GROUP.equals(objectClass)) && (filterAttr instanceof Name || filterAttr.getName().equalsIgnoreCase(ALIASES_ATTR)))

      Also as part of troubleshooting this, having a log statement to indicate whether you are reading or querying is helpful.

      logger.ok("Searching User query

      {0}", query);
      logger.ok("Reading User query {0}

      key

      {1}

      ", query, AttributeUtil.getAsStringValue(key));

      Steps to replicate:
      Issue the query /givenName eq John.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                petr.jurica Petr Jurica [X] (Inactive)
                Reporter:
                margaret.rizkalla Margaret Rizkalla
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: