0

I assume there is an API somewhere that the adduser command uses. I want to create users in my application. Any pointers?

1 Answer 1

1

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)
Sign up to request clarification or add additional context in comments.

1 Comment

Not want I'm looking for, but it may be a useful hint for an alternative solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.