Rohit Prasad
Rohit Prasad

Reputation: 475

Filter Application Based on IdentifierURIs

I'm trying to filter application using Graph API:

GET https://graph.microsoft.com/beta/applications?$filter=identifierUris/any(c:c eq 'https://testingSAML.com')

It returns the application details. But when I try with:

GET https://graph.microsoft.com/beta/applications?$filter=identifierUris/any(c:c eq 'security-saml')

It returns nothing.

I tried to create an app and added identifierURIs value like security-saml, https://testingSAML.com, etc . I able to add value to the identifierURIs but when I try to filter with "security-saml", it is not working but it is working for "https://testingSAML.com".

Whether I am missing anything here?

Upvotes: 1

Views: 671

Answers (1)

Sridevi
Sridevi

Reputation: 22242

I tried to reproduce the same in my environment and got below results

I registered one Azure AD B2C application and added same identifierURIs as you but got error like below:

"identifierUris": ["https://testingSAML.com","security-saml"],

enter image description here

If I change that to only security-saml, I'm getting different error like below:

enter image description here

You can check the supported identifierUris formats from this MS Document. In B2C tenants, it's necessary to have either https:// or api:// as prefix to add identifierURIs.

I assume https://testingSAML.com is your custom domain and you are in normal Azure AD directory, so it worked for you. In my case, I changed it to tenant name by appending string at end like below:

"identifierUris": ["https://tenantname.onmicrosoft.com/<string>"],

enter image description here

To add security-saml too, I appended api:// before it like below:

enter image description here

Now I tried to filter the applications from Graph API and got results successfully like below:

GET https://graph.microsoft.com/beta/applications?$filter=identifierUris/any(c:c eq 'https://tenantname.onmicrosoft.com/testingSAML')

Response:

enter image description here

When I tried to filter with only security-saml, I got blank results like below:

GET https://graph.microsoft.com/beta/applications?$filter=identifierUris/any(c:c eq 'security-saml')

Response:

enter image description here

When I tried filtering applications with api://security-saml, I got the results successfully like below:

GET https://graph.microsoft.com/beta/applications?$filter=identifierUris/any(c:c eq 'api://security-saml')

Response:

enter image description here

Make sure to switch your directory to B2C tenant before registering application and add identifierURIs by considering the supported formats.

Upvotes: 2

Related Questions