You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: new pagination logic increments page index incorrectly #783
Other paginated queries, e.g. listing users, and in the AsyncClient, also suffer from this. I found more than 60 occurrences of the pattern page = page + len(items or []) in the code base.
importhttpxclass_Client(httpx.Client):
"""Custom client class to work-around a pagination bug in the Auth0 SDK. Keep track of correct page number, instead of relying on incorrect page increment implemented in the library. Reset page count before using the `users.list` or `roles.list` methods. Cf. https://github.com/auth0/auth0-python/issues/783 """def__init__(self, **kwargs):
self._page=0super().__init__(**kwargs)
defrequest(self, method, url, **kwargs):
ifurl.split("/")[-1] in ("users", "roles") andmethod=="GET":
params=dict(kwargs.get("params", [("page", 0)]))
params["page"] =self._pageself._page+=1kwargs["params"] =list(params.items())
returnsuper().request(method, url, **kwargs)
interface=ManagementClient(domain=domain, client_id=client_id, client_secret=secret, httpx_client=_Client())
print(interface.roles.list(per_page=10))
# Reset page counterinterface._api._client_wrapper.httpx_client.httpx_client._page=0print(interface.users.list(per_page=10))
Activity
slash-oleh commentedon Mar 12, 2026
Having something similar here:
The client logs these:
I think
page=3clearly indicates there should be either offsetpage=1oroffset=3.Work around Auth0 SDK pagination bug
pylipp commentedon Mar 16, 2026
Working around with a custom client:
feat+fix: Pagination fix, SDK logging, OAuth1/DPoP types (auth0#785)