'How to get SharePoint (globa) user with Office365-REST-Python

I'm using Office365-REST-Python to work with SharePoint Online and i know how to reach or ask about site (example_site) user:

from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext

site_url = 'https://sharepoint.com/sites/example_site/'
site_user = 'user'
site_secret = 'secret'

context_auth = AuthenticationContext(url=site_url)
context_auth.acquire_token_for_app(site_user, site_secret)
context = ClientContext(site_url, context_auth)

web = context.web
context .load(web)

users = web.site_users
ctx.load(users)
ctx.execute_query()

But the question is how to ask about any SharePoint user (globally not only site user).

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source