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

    XO Community Edition - Ldap Plugin not working ?

    Scheduled Pinned Locked Moved Xen Orchestra
    55 Posts 7 Posters 2.8k Views 8 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.
    • K Offline
      kagbasi-ngc @olivierlambert
      last edited by

      @olivierlambert My attempts to deploy XOA via https://vates.tech/deploy/ has failed (twice now). Each time, the deployment gets to about 80% and then errors out (with a very vague message).

      Screenshot 2024-12-11 031912.png

      However, when I go back into the VM listing in XOCE, I see an XOA VM listed but not running. If I attempt to start it, it will hang at 83% starting then eventually the VM gets deleted (not sure how long cos I wasn't tracking).

      Screenshot 2024-12-11 032451.png

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Are you using DHCP or static IP?

        K 2 Replies Last reply Reply Quote 0
        • K Offline
          kagbasi-ngc @olivierlambert
          last edited by

          @olivierlambert DHCP. I could retry using static?

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            Sure, also double check you are selecting the right network. You can read logs to try to understand what's going on.

            K 1 Reply Last reply Reply Quote 0
            • K Offline
              kagbasi-ngc @olivierlambert
              last edited by

              @olivierlambert Which logs please? I'm still learning so not familiar with where all the logs are, outside of what I see within XO - and those errors are very vague.

              1 Reply Last reply Reply Quote 0
              • K Offline
                kagbasi-ngc @olivierlambert
                last edited by

                @olivierlambert I have tried deploying XOA using a static IP and the result is the same. It fails after 80% completion, with that exclamation sign. As before, I see the VM on the host but it does not have the IP address I set and it does not start (hangs at 83%).

                Any other way I can get XOA?

                K 1 Reply Last reply Reply Quote 0
                • K Offline
                  kagbasi-ngc @kagbasi-ngc
                  last edited by

                  @olivierlambert So after resolving the control domain space issues, I was able to successfully deploy XOA to the same host and wanted to test out the LDAP settings on XOA, but noticed that only two plugins come loaded with the install:

                  Screenshot 2024-12-13 045740.png

                  How do I install the LDAP plugin?

                  1 Reply Last reply Reply Quote 0
                  • olivierlambertO Offline
                    olivierlambert Vates 🪐 Co-Founder CEO
                    last edited by

                    You need to start a trial 🙂

                    K 1 Reply Last reply Reply Quote 0
                    • K Offline
                      kagbasi-ngc @olivierlambert
                      last edited by

                      @olivierlambert I tried to but got a message that I've already consumed my trial. I did I did a trial a couple of years back when I was first introduced to XCP-ng, can't recall exactly.

                      Would it be possible to grant me another trial? If so, my account is tied to kagbasi [AT] wgsdac.org

                      1 Reply Last reply Reply Quote 0
                      • olivierlambertO Offline
                        olivierlambert Vates 🪐 Co-Founder CEO
                        last edited by

                        New trial generated 🙂

                        K 1 Reply Last reply Reply Quote 0
                        • K Offline
                          kagbasi-ngc @olivierlambert
                          last edited by

                          @olivierlambert Thanks for extending the trial, much appreciated. I was able to activate the auth-ldap plugin (v0.10.10) with the same settings I used in my XOCE instance and it failed the test, even though the Wireshark capture seems to suggest the bind was successful.

                          ERROR MESSAGE IN XOA:

                          plugin.test
                          {
                            "id": "auth-ldap",
                            "data": {
                              "username": "yykagbasi",
                              "password": "* obfuscated *"
                            }
                          }
                          {
                            "message": "Illegal unescaped character: ( in value: ({name}",
                            "name": "Error",
                            "stack": "Error: Illegal unescaped character: ( in value: ({name}
                              at Function._unescapeHexValues (/opt/xo/xo-builds/xen-orchestra-202412100608/node_modules/ldapts/FilterParser.ts:334:17)
                              at Function._parseExpressionFilterFromString (/opt/xo/xo-builds/xen-orchestra-202412100608/node_modules/ldapts/FilterParser.ts:247:29)
                              at Function._parseString (/opt/xo/xo-builds/xen-orchestra-202412100608/node_modules/ldapts/FilterParser.ts:198:31)
                              at Function._parseString (/opt/xo/xo-builds/xen-orchestra-202412100608/node_modules/ldapts/FilterParser.ts:154:44)
                              at Function.parseString (/opt/xo/xo-builds/xen-orchestra-202412100608/node_modules/ldapts/FilterParser.ts:31:38)
                              at Client.search (/opt/xo/xo-builds/xen-orchestra-202412100608/node_modules/ldapts/Client.ts:584:31)
                              at AuthLdap._authenticate (/opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server-auth-ldap/src/index.js:277:55)
                              at default.testPlugin (file:///opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server/src/xo-mixins/plugins.mjs:285:5)
                              at Xo.test (file:///opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server/src/api/plugin.mjs:109:3)
                              at Task.runInside (/opt/xo/xo-builds/xen-orchestra-202412100608/@vates/task/index.js:172:22)
                              at Task.run (/opt/xo/xo-builds/xen-orchestra-202412100608/@vates/task/index.js:156:20)
                              at Api.#callApiMethod (file:///opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server/src/xo-mixins/api.mjs:469:18)"
                          }
                          

                          WIRESHARK CAPTURE:
                          Screenshot 2024-12-13 182956.png

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

                            @kagbasi-ngc Try changing ({name}) to {{name}} in your user filter

                            K 1 Reply Last reply Reply Quote 0
                            • K Offline
                              kagbasi-ngc @Danp
                              last edited by kagbasi-ngc

                              @Danp Good catch!

                              I fixed it and I was now getting the previous error I was getting:

                              plugin.test
                              {
                                "id": "auth-ldap",
                                "data": {
                                  "username": "yykagbasi",
                                  "password": "* obfuscated *"
                                }
                              }
                              {
                                "message": "could not authenticate user",
                                "name": "Error",
                                "stack": "Error: could not authenticate user
                                  at /opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server-auth-ldap/src/index.js:246:15
                                  at default.testPlugin (file:///opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server/src/xo-mixins/plugins.mjs:285:5)
                                  at Xo.test (file:///opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server/src/api/plugin.mjs:109:3)
                                  at Task.runInside (/opt/xo/xo-builds/xen-orchestra-202412100608/@vates/task/index.js:172:22)
                                  at Task.run (/opt/xo/xo-builds/xen-orchestra-202412100608/@vates/task/index.js:156:20)
                                  at Api.#callApiMethod (file:///opt/xo/xo-builds/xen-orchestra-202412100608/packages/xo-server/src/xo-mixins/api.mjs:469:18)"
                              }
                              

                              So that got me thinking that perhaps there was a special character in my password that was causing the query to fail. It was interest to me that the LDAP bind was successful, but the query was returning no results, even though the response packet (as seen in Wireshark) contain results that I thought were valid.

                              So I performed several tests, with various variations of my username and password combinations. I even created a new user and test - the results were mixed. Sometimes succeeding and sometimes failing. However, I noticed that all the successful tests were with the new test account I'd created, not my personal account. So I compared the two, and realized that my account was part of 9 Security Groups whereas the test account was a member of only 2 Security Groups. So to confirm, I removed myself from all but 2 groups and tested, and it was successful. To confirm, I added myself to a 3rd group and tested - FAILURE.

                              So, at this juncture, it seems as though when a user is a member of more than 2 groups in AD, the LDAP query is failing (or at least the plugin test if failing - haven't attempted to login to XO to confirm).

                              Has anybody seen this behavior in their environments? By the way, I noticed this behavior in both XOA and XOCE.

                              UPDATE:

                              • I confirmed that as long as I kept my AD Group Membership to less than 3, I was able to login using my domain credentials. The moment I added a 3rd group, login failed.

                              • Noticed also that if my primary group is anything other than Domain Users, login fails (even if my group count is under 3).

                              1 Reply Last reply Reply Quote 0
                              • olivierlambertO Offline
                                olivierlambert Vates 🪐 Co-Founder CEO
                                last edited by

                                So do you confirm, regardless XOA or XO from the sources, as soon as you get a group with more than 3 ppl you have an issue? 🤔

                                K 1 Reply Last reply Reply Quote 0
                                • K Offline
                                  kagbasi-ngc @olivierlambert
                                  last edited by

                                  @olivierlambert No, it's the other way around. Once the subject user is a memberof 3 or more groups, the problem occurs.

                                  1 Reply Last reply Reply Quote 1
                                  • olivierlambertO Offline
                                    olivierlambert Vates 🪐 Co-Founder CEO
                                    last edited by

                                    Okay and regardless XOA or XO from the sources, right?

                                    K 1 Reply Last reply Reply Quote 0
                                    • K Offline
                                      kagbasi-ngc @olivierlambert
                                      last edited by

                                      @olivierlambert Yes sir.

                                      Would you like me to create a video of it happening? I'm home all day today, so I can run any test you need me to. Just let me know.

                                      1 Reply Last reply Reply Quote 0
                                      • olivierlambertO Offline
                                        olivierlambert Vates 🪐 Co-Founder CEO
                                        last edited by

                                        I don't see it's needed. It's maybe something weird between AD and the LDAP plugin (or a misconfig somewhere?)

                                        IDK what kind of debug could help, pinging @pdonias

                                        K 1 Reply Last reply Reply Quote 0
                                        • K Offline
                                          kagbasi-ngc @olivierlambert
                                          last edited by

                                          @olivierlambert When I get to work tomorrow, I'll check my AD account in my lab to see how many groups I'm a member of. If you'll recall, I didn't have any issue at all getting the plugin to work on the first try within the air-gapped test lab.

                                          pdoniasP 1 Reply Last reply Reply Quote 0
                                          • pdoniasP Offline
                                            pdonias Vates 🪐 XO Team @kagbasi-ngc
                                            last edited by

                                            Hi @kagbasi-ngc,

                                            To try and figure out what's happening, you can add this to your xo-server config:

                                            [logs]
                                            filter = 'xo:auth-ldap
                                            

                                            Then run the plugin test again and see if xo-server's logs give more information.

                                            K 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post