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

MS Graph API Connector: Add ConsistencyLevel: eventual' header and $count=true for endsWith filter

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.19.5
    • 1.5.20.0
    • MS Graph API Connector
    • None
    • 57578

    Description

      Customer is able to query from postman and it works fine. Below is the query

       

      curl --location --request GET 'https://graph.microsoft.com/v1.0/users?$count=true&$filter=endsWith(userPrincipalName,%27@identitydev.deloitte%27)&$select=id,displayName,mail' \
      --header 'SdkVersion: postman-graph/v1.0' \
      --header 'ConsistencyLevel: eventual' \
      --header 'Authorization: Bearer

       

      However when they try to use 'ew' in the query filter in the connector endpoint we get a bad request error for graph in the logs.

       

      Error message: Unsupported Query.
      
      
      GET https://graph.microsoft.com/v1.0/users?%24select=mail%2CcompanyName%2Cid&%24filter=endswith%28userPrincipalName%2C%27%40identityqa.deloitte%27%29
      SdkVersion : graph-java/v2.5.0
      Authorization : [PII_REDACTED]
      400 : Bad Request
      

       

      It was pointed out by engineering this is related to https://github.com/microsoftgraph/microsoft-graph-docs/issues/4331

       

       

      Engineering was able to confirm that if you add both 'ConsistencyLevel: eventual' header and $count=true 
      then the endwith filter works
      GET /openidm/system/msgraph/user?_queryFilter=mail+ew+'rock.com'&_fields=displayName,mail{
          "result": [
              {
                  "_id": "02d45e6f-e47c-4eb1-9bb3-af8a7bcbbeaa",
                  "displayName": "idm test3",
                  "mail": "idm.test3@forgerock.com"
              },
              {
                  "_id": "128b7f5c-d4ba-4ae4-8ad2-8c5c4ab2ac97",
                  "displayName": "",
                  "mail": "@forgerock.com"
              }
          ],
          "resultCount": 2,
          "pagedResultsCookie": null,
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
      }
      

       

       

      Attachments

        Issue Links

          Activity

            People

              gael Gael Allioux
              marcus.bonin Marcus Bonin
              Son Nguyen Son Nguyen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: