For the moment, only the REST service called configuration in Constellation is secured (more to come
)
This module requires to be logged in, in order to use its functionalities.
That's why, when a user tries to connect on the url http://<server_address>/constellation/WS/configuration, a pop-up will appear to allow user to provide autentication.
This part needs to be configured in different ways, according to the application server chosen.
Glassfish
A realm "UserDatabase" needs to be created into the admin interface.
To do so, in the interface go into the Configurations / server-config / Security / Realms menu.
Click the add button and set:
Name: UserDatabase
ClassName: com.sun.enterprise.security.auth.realm.file.FileRealm (the default one).
JaasContext: fileRealm
KeyFile:
This will create a file "userdbconf" in your config directory of Glassfish. This file will contain the encrypted passwords for the users that we are going to create, plus the roles to which they belong.
Now you can save this new realm.
To finish with, we are now going to add users to this realm. To do so, edit the UserDatabase realm, and click on the button "Manage users". To log in, you need a user into the "adminstrator" group, so create a new user (for example bob) who belongs to the group administrator, and choose an appropriate password.
After restarting the domain of Glassfish, you will be able to use the configuration service with this user.
Tomcat
It is simplier here than for Glassfish. The "UserDatabase" realm is already created on every Tomcat 5.5 and 6.x by default.
This realm (for which the definition can be retrieved into the server.xml file on the conf directory of Tomcat) is in fact connected to the file tomcat-users.xml in the same directory.
In fact, you just have to define in the tomcat-users.xml file:
(if not already present), and to define that a user is in the role admin.
For example: