Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

?$filter=identities/any(c:c/issuerAssignedId eq '[email protected]') is returning error

I need to find a user in my B2C with issuerAssignedId equal with specific email.

My query is like this:

GET https://graph.microsoft.com/v1.0/users/?$filter=identities/any(c:c/issuerAssignedId eq '[email protected]')

However, I get the following error.


{
  "error": {
    "code": "Request_UnsupportedQuery",
    "message": "Issuer is not set in the query. Issuer issuer, IssuerUserId: issuerUserId",
    "innerError": {
      "date": "2023-05-12T01:38:42",
      "request-id": "9961ba9b-4027-45ab-bdf7-024ab80c634b",
      "client-request-id": "9961ba9b-4027-45ab-bdf7-024ab80c634b"
    }
  }
}

How can I fix the query above?

like image 519
Allan Xu Avatar asked Sep 11 '25 03:09

Allan Xu


2 Answers

When filtering on the identities property for an issuerAssignedId, you must supply both issuer and issuerAssignedId.

GET https://graph.microsoft.com/v1.0/users?$filter=identities/any(c:c/issuerAssignedId  eq '[email protected]' and c/issuer eq 'My B2C tenant')

Resources:

Object identity - filtering

Filter example

like image 113
user2250152 Avatar answered Sep 12 '25 23:09

user2250152


Check the following With the following query

GET https://graph.microsoft.com/v1.0/users/?$filter=identities/any(c:c/issuerAssignedId eq '[email protected]' Got the error:

{
    "error": {
        "code": "Request_UnsupportedQuery",
        "message": "Issuer is not set in the query. Issuer issuer, IssuerUserId: issuerUserId",
        
    }
}

enter image description here Try the following query:

https://graph.microsoft.com/v1.0/users/?$filter=identities/any(c:c/issuerAssignedId  eq 'kxxxb2c.onmicrosoft.com' and c/issuer eq 'kxxxb2c.onmicrosoft.com')

It runs without any error:

enter image description here

But check the following to see the known issues:

User query $filter ignores identities/issuer - MS Graph API and Azure B2C - Microsoft Q&A

like image 40
kavya Saraboju Avatar answered Sep 13 '25 00:09

kavya Saraboju