Description of problem: Passing the same username and password to add-user non-interactively throws RuntinmeException. Version-Release number of selected component (if applicable): 6.2.0 How reproducible: always Steps to Reproduce: 1. Navigate inte $EAP_HOME/bin directory 2. Run: add-user.[sh|bat] asdasd@2 asdasd@2 Actual results: --------------------------------- * Error * JBAS015238: Username must not match the password. Exception in thread "main" java.lang.RuntimeException: JBAS015238: Username must not match the password. at org.jboss.as.domain.management.security.adduser.ErrorState.execute(ErrorState.java:67) at org.jboss.as.domain.management.security.adduser.AddUser.run(AddUser.java:130) at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:208) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.modules.Module.run(Module.java:292) at org.jboss.modules.Main.main(Main.java:455) --------------------------------- Expected results: --------------------------------- * Error * JBAS015238: Username must not match the password. ---------------------------------
Same with the missing password: bin]$ ./add-user.sh admin * Error * JBAS015236: No Password entered, exiting. Exception in thread "main" java.lang.RuntimeException: JBAS015236: No Password entered, exiting. at org.jboss.as.domain.management.security.adduser.ErrorState.execute(ErrorState.java:67) at org.jboss.as.domain.management.security.adduser.AddUser.run(AddUser.java:130) at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:208) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.modules.Module.run(Module.java:292) at org.jboss.modules.Main.main(Main.java:455)
Also non-alphanumeric character in password throws RE: bin]$ ./add-user.sh aaa#aaa asdasd@2 * Error * JBAS015239: Only alpha/numeric usernames accepted. Exception in thread "main" java.lang.RuntimeException: JBAS015239: Only alpha/numeric usernames accepted. at org.jboss.as.domain.management.security.adduser.ErrorState.execute(ErrorState.java:67) at org.jboss.as.domain.management.security.adduser.AddUser.run(AddUser.java:130) at org.jboss.as.domain.management.security.adduser.AddUser.main(AddUser.java:208) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.modules.Module.run(Module.java:292) at org.jboss.modules.Main.main(Main.java:455)
Darran, please investigate. Thanks!
Same exception for non-existing properties file bin]$ ./add-user.sh -a -u appuser1 -p password1! -g app1group -sc /home/someusername/userconfigs/ -up appusers.properties -gp appgroups.properties Exception in thread "main" java.lang.RuntimeException: JBAS015234: No appusers.properties files found
Just checked and this does not appear to be an upstream issue, this is not surprising as password validation has moved on considerably upstream - the fix here is going to be EAP specific.
Outputting the exception is valid as this is to indicate to scripts calling in non-interactive mode that a failure occurred - however we should use out own exception type instead of RuntimeException.
Darran Lofthouse <darran.lofthouse> updated the status of jira WFLY-3130 to Coding In Progress
Verified on EAP 6.3.0.DR6
Refactored release notes text and marked for inclusion in documentation.
Changed <literal></literal> tags in Doc Text to ticks (`) to fix Bug 1096865