Getting login pages with filter "source eq 'global'" results in error #763
noethig
started this conversation in
Show and tell
Replies: 1 comment
-
I just created a workaround that handles the serialization. Although it might not yet be optimal, it should be a great place to get started. In general it's just a replacement for the method in login_pages_request_builder.py LoginPagesRequestBuilder.get(...) from kiota_abstractions.serialization import ParsableFactory
from kiota_abstractions.request_information import RequestInformation
from msgraph.generated.models.o_data_errors.o_data_error import ODataError
from msgraph.generated.models.login_page_collection_response import LoginPageCollectionResponse
async def __login_pages_get_all_global(self) -> Optional[LoginPageCollectionResponse]:
url_template = '{+baseurl}/security/attackSimulation/loginPages{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}'
path_parameters = {'base_url': 'https://graph.microsoft.com/v1.0'}
request_info = RequestInformation(Method.GET, url_template, path_parameters)
request_info.query_parameters = {'%24filter': "source eq 'global'", '%24select': ['id', 'displayName', 'language', 'source']}
request_info.url = '/security/attackSimulation/loginPages?%24filter=source%20eq%20%27tenant%27&%24select=id,displayName,language,source'
auth_token = await self.get_access_token()
request_info.headers.try_add("Accept", "application/json")
request_info.headers.try_add("Authorization", f"Bearer {auth_token}")
error_mapping: Dict[str, ParsableFactory] = {
"XXX": ODataError,
}
return await self.graph_client.request_adapter.send_async(request_info, LoginPageCollectionResponse, error_mapping) The only thing to do is to get the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I took the following code from the API documentation:
Expected behavior
The function
await graph_client.security.attack_simulation.login_pages.get(...)
should return all login pages.How to reproduce
Minimal working example:
SDK Version
1.4.0
Latest version known to work for scenario above?
No response
Known Workarounds
A workaround is to just write a get request with another library. But that should be done by this SDK, if it would work...
Debug output
Click to expand log
Configuration
I think that problem is not specific to this configuration.
Other information
Taking the same code (minimal working example) and only changing the filter from
filter="source eq 'global'"
tofilter="source eq 'tenant'"
, the SDK call works as expected.The error cause seems to be here:
Copied source code:
The member
Global_
seems to cause the problem because of the trailing_
. I don't quite understand, why this members needs the trailing_
and would be happy to learn more about that.Beta Was this translation helpful? Give feedback.
All reactions