filter for onPremises
Net-Felix opened this issue · 3 comments
Hi,
I've tried to filter against onPremisesSamAccountName but i get the following error:
ERROR: 2023-06-19T08:28:43.858Z: graph.fetch.js callApi error with {
endpoint: "https://graph.microsoft.com/beta/users?$select=businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,id,identities,userType,externalUserState,onPremisesSamAccountName,customSecurityAttributes&$filter=onPremisesSamAccountName ne ''&$count=true",
opts: {},
error: 'Request failed with status code 400'
}
according to microsoft i need an additional header: https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http
i've manually added the header in graph.fetch.js:
fetch.callApi = async function (endpoint, accessToken, opts = {}, skipError = true) {
const options = {
headers: {
Authorization: `Bearer ${accessToken}`,
ConsistencyLevel: 'eventual'
}
};
....
but still the same error :(
An empty filter value seems not to be supported by "ne". You can use this site build/test the endpoint url: https://developer.microsoft.com/en-us/graph/graph-explorer
I have made a few small adjustments. The advanced filters should now be supported without any changes to the code. Furthermore, the error of the Graph API should also be output. It is available in the Docker DEV tag now. I hope this helps with troubleshooting :)
The fixes are now available in the latest version :)