-
Bug
-
Resolution: Unresolved
-
Major
-
jenkins 1.419
You cannot specify a username:
java -jar jenkins-cli.jar -s http://ci.example.com:8080 login --username asdf --password asdf
"--username" is not a valid option
java -jar jenkins-cli.jar login args...
Saves the current credential to allow future commands to run without explicit credential information
and cant use the login command
java -jar jenkins-cli.jar -s http://ci.example.com:8080 login
org.acegisecurity.userdetails.UsernameNotFoundException: Active-directory plugin doesn't support user retrieval
at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.loadUserByUsername(ActiveDirectoryUnixAuthenticationProvider.java:71)
at hudson.security.SecurityRealm.loadUserByUsername(SecurityRealm.java:305)
at hudson.cli.ClientAuthenticationCache.set(ClientAuthenticationCache.java:94)
at hudson.cli.LoginCommand.run(LoginCommand.java:37)
at hudson.cli.CLICommand.main(CLICommand.java:184)
at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:82)
at sun.reflect.GeneratedMethodAccessor587.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:255)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:215)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
With the modern SSH public key based authentication, I consider this issue resolved.
See https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI for more details about how to do it.