eclipsewildfly-12

Enable Admin Console on WildFly 12 running in Eclipse


I installed WildFly server today into Eclipse, and I'm able to run web applications. I'd like to be able to log in to the Admin Console. I haven't enabled it though, so I see this :

Your WildFly Application Server is running.
However you have not yet added any users to be able to access the admin console.

To add a new user execute the add-user.bat script within the bin folder of your WildFly installation and enter the requested information.

Well, I ran the add-user.bat script in the bin directory of my wildfly install. It seemed to run without any problems. I still get the same error.

I'm guessing that Eclipse copies my wildfly install and places it in some hidden directory. No idea where that is though. Any ideas?


Solution

  • Section 3.3 of the Wildfly 12 Admin Guide describes the process for adding a user in order to be able to access Wildfly's admin console:

    To manipulate the files and add users we provide a utility add-user.sh and add-user.bat to add the users and generate the hashes, to add a user you should execute the script and follow the guided process. The full details of the add-user utility are described later but for the purpose of accessing the management interface you need to enter the following values: -

    • Type of user - This will be a 'Management User' to selection option a.

    • Realm - This MUST match the realm name used in the configuration so unless you have changed the configuration to use a different realm name leave this set as 'ManagementRealm'.

    • Username - The username of the user you are adding.

    • Password - The users password.

    Provided the validation passes you will then be asked to confirm you want to add the user and the properties files will be updated.

    For the final question, as this is a user that is going to be accessing the admin console just answer 'n' - this option will be described later for adding slave host controllers that authenticate against a master domain controller but that is a later topic.

    Updates to the properties file are picked up in real time so either click 'Try Again' on the error page that was displayed in the browser or navigate to the console again and you should then be prompted to enter the username and password to connect to the server.

    There are a couple of potential pitfalls when running the add-user utility:

    But rather than diagnosing what went wrong, it's easier just to try adding another user, following the directions given in the documentation shown above. For reference, here's a screen shot of what I did, where the yellow horizontal bars are points at which I submitted something from the keyboard:

    addUserUtility

    After running add-user.bat I was able to login to the Admin Console (http://localhost:9990) using the user I had just created, and no server restart was necessary. My environment was Eclipse Photon on Windows 10.

    If you are still having problems, open the file mgmt-users.properties to see whether your user was added successfully. In my case a line was added for the new user that looked like this:

    skomisa=82fa5e2f2de46d60adf210bb95d461f3