Adding new ADMIN user thought REST API

Is it possible to add a new admin user through the REST API as we can add a regular user?

And the second question is, can we get a list of all admin users through the REST API?

ATM:
Adding a new user has two possibilities:

  1. run console command (all time I have to go on the production environment and do that manually there)
    pi-manage admin add admin -e admin@localhost

  2. insert new record directly in the DB (manually on the production too)

Hello @Kolesar,
welcome to privacyidea.

You need to define admin users. See https://privacyidea.readthedocs.io/en/latest/faq/admins.html

The internal admins are “above the law” and are not supposed to be modified via the REST API on purpose.
You can only manage internal admins via the CLI tool pi-manage admin.

Hi @cornelinux,

Thanks for the reply.

Maybe I was no clear in the initial post, and I will try to explain again.

I already have a list of admin users which I import via small script on warm-up on my Production environment. BUT, what if I want to add one new admin user? I have to connect to my production environment and do that manually through the Command line? It is not practical at all :frowning:

I need an option to very easy to add a new admin user (and get a list of current admins, of course) via UI or at least via REST API. Do you have any other option for adding admin users except the Command line?

I understood you, but maybe you did not read the link I posted and did not try to understand the concept of administratvie realms, which in fact is, what you are looking for.

Yes you would have to do this, if you insist on using internal admins!

This is your own lonely opinion. As I said this is on purpose. So stop insinsting on claiming what is practical or not. Either try to understand things, or design and implement your own 2FA system!

You could create users in a resolver in an administratrive realm via the REST API and achieve exactly what you are looking for. You might continue calling it not practical, I call it flexible.

Hi @cornelinux,

I must really humbly say, thank you so much for your pragmatism.