XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    User credentials with xo-cli

    Scheduled Pinned Locked Moved Infrastructure as Code
    6 Posts 2 Posters 698 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      henry.lin0u812
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • DanpD Offline
        Danp Pro Support Team
        last edited by

        I haven't tried this, but did you try wrapping the password in quotes?

        H 1 Reply Last reply Reply Quote 0
        • H Offline
          henry.lin0u812 @Danp
          last edited by

          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
          }
          
          DanpD 1 Reply Last reply Reply Quote 0
          • DanpD Offline
            Danp Pro Support Team @henry.lin0u812
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • H Offline
              henry.lin0u812
              last edited by

              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.

              H 1 Reply Last reply Reply Quote 0
              • H Offline
                henry.lin0u812 @henry.lin0u812
                last edited by henry.lin0u812

                Ok, using a LDAP authenticated user is the problem. It works fine with a native XO account. Is there any way around this?

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post