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?
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
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",
        
    }
}
 Try the following query:
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:

But check the following to see the known issues:
User query $filter ignores identities/issuer - MS Graph API and Azure B2C - Microsoft Q&A
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With