Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter for onPremises #55

Closed
Net-Felix opened this issue Jun 19, 2023 · 3 comments
Closed

filter for onPremises #55

Net-Felix opened this issue Jun 19, 2023 · 3 comments

Comments

@Net-Felix
Copy link

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 :(

@ahaenggli
Copy link
Owner

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

@ahaenggli
Copy link
Owner

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 :)

@ahaenggli
Copy link
Owner

The fixes are now available in the latest version :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants