Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.15.2. JAAS Console Commands
Editing user data from the console Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Red Hat JBoss Fuse provides a set of
jaas:* console commands, which you can use to edit JAAS user data from the console.
Note
The
jaas:* console commands are not compatible with the LDAP JAAS module.
Standalone realm configuration Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
A standalone container (which uses the JAAS
PropertiesLoginModule and the PublickeyLoginModule) maintains its own database of secure user data, independently of any other containers. To configure the user data for a standalone container, you must log into the specific container (see Connecting and Disconnecting Remotely) whose data you want to modify. Each standalone container must be configured separately.
To start editing the standalone JAAS user data, you must first specify the JAAS realm that you want to modify. To see the available realms, enter the
jaas:realms command, as follows:
JBossFuse:karaf@root> jaas:realms
Index Realm Module Class
1 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
2 karaf org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
JBossFuse:karaf@root> jaas:realms
Index Realm Module Class
1 karaf org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
2 karaf org.apache.karaf.jaas.modules.publickey.PublickeyLoginModule
Both of these login modules are active in the default
karaf JAAS realm. Enter the following console command to start editing the properties login module in the karaf realm:
JBossFuse:karaf@root> jaas:manage --index 1
JBossFuse:karaf@root> jaas:manage --index 1
Adding a new user to the JAAS realm Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
For example, consider how to add a new user,
jdoe, to the JAAS realm.
First of all, start to manage the relevant JAAS realm as follows:
- List the available realms and login modules by entering the following command:
JBossFuse:karaf@root> jaas:realms
JBossFuse:karaf@root> jaas:realmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Choose the login module to edit by specifying its index, Index, using a command of the following form:
JBossFuse:karaf@root> jaas:manage --index Index
JBossFuse:karaf@root> jaas:manage --index IndexCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Add the user,
jdoe, with password, secret, by entering the following console command:
JBossFuse:karaf@root> jaas:useradd jdoe secret
JBossFuse:karaf@root> jaas:useradd jdoe secret
Add the
admin role to jdoe, by entering the following console command:
JBossFuse:karaf@root> jaas:roleadd jdoe admin
JBossFuse:karaf@root> jaas:roleadd jdoe admin
As a matter of fact, these changes are not applied right away. Initially, the changes are queued in a list of pending operations. To see this list, enter the
jaas:pending console command, as follows:
JBossFuse:karaf@root> jaas:pending
Jaas Realm:karaf Jaas Module:org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
UserAddCommand{username='jdoe', password='secret'}
RoleAddCommand{username='jdoe', role='admin'}
JBossFuse:karaf@root> jaas:pending
Jaas Realm:karaf Jaas Module:org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
UserAddCommand{username='jdoe', password='secret'}
RoleAddCommand{username='jdoe', role='admin'}
Now you can apply the changes by invoking
jaas:update, as follows:
JBossFuse:karaf@root> jaas:update
JBossFuse:karaf@root> jaas:update
The new user entry is then persisted (either by writing to the remote container's
etc/users.properties file, in the case of a standalone container, or by storing the user data in the Fabric Registry, in the case of a fabric).
Canceling pending changes Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
If you decide that you do not want to make the changes permanent after all, instead of invoking the
jaas:update command, you could abort the pending changes using the jaas:cancel command, as follows:
JBossFuse:karaf@root> jaas:cancel
JBossFuse:karaf@root> jaas:cancel