I assume there is an API somewhere that the adduser command uses. I want to create users in my application. Any pointers?
1 Answer
The logic of password hashing is implemented in JBoss SASL UsernamePasswordHashUtil class. Look at GitHub.
Sample usage:
import org.jboss.sasl.util.UsernamePasswordHashUtil;
UsernamePasswordHashUtil util = new UsernamePasswordHashUtil();
System.out.println(userName +
"=" +
util.generateHashedHexURP(userName, realm, password));
There is also a possibility to use a simple property file with "username=password" rows. Just set security realm attribute "plain-text=true".
/core-service=management/security-realm=TestRealm/authentication=properties:add(path="/path/to/users.properties", plain-text=true)
1 Comment
robinr
Not want I'm looking for, but it may be a useful hint for an alternative solution