Filtering by username in a list using Graph API for Azure AD B2C

Hiep To 0 Reputation points

Hi all,

We're trying to use MS Graph API v1.0 to query the list of user having username provided in a list string. However the IN operator throw not support query, is there anything we could do or when it will be supported.

WORK:$select=displayName,givenName&$filter=identities/any(id:id/issuerAssignedId in ('CUSTOMER11') and id/issuer+eq+'')

NOT WORKING:$select=displayName,givenName&$filter=identities/any(id:id/issuerAssignedId in ('CUSTOMER11','CUSTOMER20') and id/issuer+eq+'')

 "error": {

        "code": "Request_UnsupportedQuery",

        "message": "Unsupported Query.",

        "innerError": {

            "date": "2024-06-07T08:56:33",

            "request-id": "a0c9aca0-4ecf-478e-ab99-38faa35610ce",

            "client-request-id": "a0c9aca0-4ecf-478e-ab99-38faa35610ce"



Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,118 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 39,021 Reputation points

    Hi @Hiep To

    The Graph API has very limited support for Azure AD B2C, and it does not support complex queries and advanced query capabilities.

    In the current context, you can only perform a single filtering on the user set using the issuerAssignedId and issuer properties and cannot perform more refined filtering.$select=displayName,givenName&$filter=identities/any(id:id/issuerAssignedId eq 'xxxxxxxxxxxxx' and id/issuer eq 'xxxxxxxxxxxxxxxx')

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments