Reputation: 857
I have the following code:
IConfidentialClientApplication app = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantId)
.WithClientSecret(clientSecret)
.Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(app);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var users = await graphClient
.Users
.Request()
.Filter("eq(mail, '[email protected]')")
.GetAsync();
The above throws the following exception:
Code: BadRequest
Message: Invalid filter clause
What am I doing wrong?
Upvotes: 0
Views: 151
Reputation: 10849
As per OData URI convention (read here), the filter eq
should be defined as propertyName eq PropertyValue
.
So update the filter as
.Filter("mail eq '[email protected]'")
Upvotes: 1