How to Add User in Wildfly Application Server

Posted on

Introduction

This is an article for adding a new user in Wildfly Application Server. Apparently, the user default, usually called ‘admin’, it is failing for futher user to login to the Wildfly Management Console. So, there are several ways in order to be able to login again to the Wildfly Management Console. The first one is for changing or resetting the password of that user. The other one is for adding or creating a new user.

 

Creating user for logging in to Wildfly Management Console

The following is the step for creating or adding a new user for logging in to the Wildfly Management Console :

1. Just access the command line interface.

2. After successfully accessing the command line, use the suitable user for executing the command. That command is for adding or creating a new file. For instance, in this context, use the user with the name of ‘user’.

3. Execute the command as user to create a new user for logging in to Wildfly Management Console. The command is actually a command for executing a shell script available in the Wildfly script or source installer. The following is the script file with the full path of the Wildfly script or source installer :

/opt/wildfly-14.0.1.Final/bin/add-user.sh

For an example, the following is the execution of the above script in the command line interface :

[hostname@localhost ~]$ /opt/wildfly-14.0.1.Final/bin/add-user.sh 
What type of user do you wish to add? 
 a) Management User (mgmt-users.properties) 
 b) Application User (application-users.properties)
(a): 

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : appadmin
Password recommendations are listed below. To modify thmeese restrictions edit the add-user.properties configuration file.
 - The password should be different from the username
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : 
Re-enter Password : 
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: 
About to add user 'hamster' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'appadmin' to file '/opt/wildfly-14.0.1.Final/standalone/configuration/mgmt-users.properties'ti
Added user 'appadmin' to file '/opt/wildfly-14.0.1.Final/domain/configuration/mgmt-users.properties'
Added user 'appadmin' with groups  to file '/opt/wildfly-14.0.1.Final/standalone/configuration/mgmt-groups.properties'
Added user 'appadmin' with groups  to file '/opt/wildfly-14.0.1.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process? 
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition 
[user@hostname ~]$
  1. The name of the user above for an example is ‘appadmin’. The name can be anything but choose the one representing the user for logging in. After successfully create or add the user, don’t forget to test it by logging in to the Wildfly Management Console.

Leave a Reply