User credentials with xo-cli
-
I'm new to XO and I like to use xo-cli to script management tasks. I'm having an issue with user authentication when registering with an XO server. My user password contains spaces which is causing xo-cli to error when connecting.
Is there a method to pass a password that contains spaces?
-
I haven't tried this, but did you try wrapping the password in quotes?
-
Yes. With the password in quotes, I get the following error.
JsonRpcError: invalid credentials at Peer._callee$ (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\json-rpc-peer\dist\index.js:139:44) at tryCatch (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\regeneratorRuntime.js:45:16) at Generator.<anonymous> (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\regeneratorRuntime.js:133:17) at Generator.next (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\regeneratorRuntime.js:74:21) at asyncGeneratorStep (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:17) at _next (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:17:9) at **redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:22:7 at new Promise (<anonymous>) at Peer.<anonymous> (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:14:12) at Peer.exec (**redacted**\AppData\Roaming\npm\node_modules\xo-cli\node_modules\json-rpc-peer\dist\index.js:182:20) { code: 3, data: undefined }
-
@henry.lin0u812 I verified that it works correctly for me when using quotes around a password with spaces, so something else is happening on your end. I would verify the username, password and URL.
-
Humm... could you use the syntax you're using? Here's what I'm using:
xo-cli register --au https://<XO FQDN> user "password"
One thing that just occurred to me, I'm using an LDAP authenticated account. I'll try with a native XO account.
-
Ok, using a LDAP authenticated user is the problem. It works fine with a native XO account. Is there any way around this?