privacyideaadm icon indicating copy to clipboard operation
privacyideaadm copied to clipboard

List tokens does not support/observe paging from the server

Open jimbrowne opened this issue 7 years ago • 2 comments

Per the API docs the /token API call is paged. It appears that the default page size might be 10, so for any system with more tokens than 10 a /usr/bin/privacyidea --url URL -a administrator token list will only list 10 tokens.

I don't see any support in the client lib for paging and I have not reviewed the API docs to see if other calls are paged, so I don't know if the best route is generic support for paging.

If there is no internal momentum on this project I might be able to provide code to solve this issue.

jimbrowne avatar Jan 23 '18 00:01 jimbrowne

You are right. The admin client currently will only list the first 10 tokens. But: you can always filter the tokens and thus get "other ten tokens".

privacyidea -U https://localhost/pi --nosslcheck --admin=super token list --serial='OATH001*'

or

privacyidea -U https://localhost/pi --nosslcheck --admin=super token list --user=cornelius

You are welcome to suggest some adaptions or do a pull request.

cornelinux avatar Jan 23 '18 11:01 cornelinux

Take a look at this blog post https://www.privacyidea.org/create-user-portal/ to get an idea how to use httpie to also grab your tokens via the API.

Cool tool. Also comes with colors ;-)

cornelinux avatar Jan 23 '18 11:01 cornelinux