Non-interactive add-user.sh does not give secre value
Hi,
We have a problem where we are calling add-user.sh from another script non-interactively and although it creates the user as desired but unlike interactive mode it does not provide the secret value at the end when you answer yes for the question "Is this new user going to be used for one AS process to connect to another AS process?"(this section itself does not come up). Is there a way solution to this problem where I can use the add-user.sh script in non-interactive mode but also obtain the secret value ?
Responses
Hi,
please check this link - https://docs.jboss.org/author/display/AS71/add-user+utility
specially sections called Non-Interactive Mode
//Zdenek
Is there any solution for the original question? Non-interactive mode is not displaying secret value for the management user. I am yet to dig into adduser.sh script. If there is any solution already available please post here.
Hi Joseph,
I have the same issue with non-interactive mode. One possible solution I found by looking the source code is the following:
The class generating the secret value is "org.jboss.as.domain.management.security.adduser.DisplaySecret" and the method that generates the code, does a Base64 encoding on the password only.
public State execute() {
String pwdBase64 = Base64.encodeBytes(stateValues.getPassword().getBytes());
theConsole.printf(MESSAGES.secretElement(pwdBase64));
theConsole.printf(NEW_LINE);
// This is now the final state so return null.
return null;
}
I am thinking of writing a custom utility to encode the password and then use it in my hosts.xml. The Base64 implementation is org.jboss.util.Base64 and not java.util.Base64.
I hope this helps.
Kind regards,
Petros
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
