You might not want to use the Jenkins internal user base at all. There are many plugins "Authentication and user management."
If you like MySQL, there is a MySQL authenticator (it reads the user table and passwords), and your adduser command can insert this table into this table.
If you like flat files, there is a "Script Security Realm" where you can authenticate using an arbitrary script. Write a file with user and password combinations in your favorite format, write an โadduserโ script that writes to it, and write an auth script that reads the file and determines whether to authenticate the user.
You can also connect to an LDAP server, Active Directory, Atlassian Crowd, Unix accounts (pw_auth), or any other authentication used by your application server (for example, if it disconnects from the Tomcat server, you can tell Jenkins to let Tomcat authenticate users and configure Tomcat to do it as you want.
Robert Mandeville
source share