privacyidea / privacyideaadm

:computer: This is a command line client to manage the privacyIDEA server.
GNU Affero General Public License v3.0
32 stars 10 forks source link

List tokens does not support/observe paging from the server #31

Open jimbrowne opened 6 years ago

jimbrowne commented 6 years ago

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.

cornelinux commented 6 years ago

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 commented 6 years ago

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 ;-)