Hi! Is it possible to find out how many of our use...
# ory-network
c
Hi! Is it possible to find out how many of our users are using TOTP? Ory copilot suggests the identities API, and I can get the information per user through it, but iterating through the entire userbase starts getting 504 responses from the API after a while. (CC @kind-cricket-67361)
m
Why not list all the identities at once using list identity?
<https://www.ory.sh/docs/reference/api#tag/identity>
m
We are also working on improved search functionality, not sure it that will cover it. But right now the listIdentities API is your best bet: https://www.ory.sh/docs/reference/api#tag/identity/operation/listIdentities (link might be a bit broken but its the first operation in the identity/admin APIs)
c
Thanks for the suggestion 🙂! That is how I am currently iterating the entire userbase (
/admin/identities?page_size=500&include_credential=totp
), then from the response I use the
rel="next"
to get the next page of users, and so on. This goes great for a while, but at some point the API starts returning HTTP 504 status codes. Backing off and retrying with increasing delays did not get me past this.
Just to clarify, I run into HTTP 504 status codes before I get to the end of the userbase. If I could add a search or filter to the list identities API like
&totp=enabled
the number of users to be fetched would be a lot less and I might be able to get them all before getting 504s. Do you think something like that would be covered by the upcoming search functionality @magnificent-energy-493? Any other options come to mind for the short term?