Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    API Key "impersonate user" doesn't work when impersonating an LDAP user

    Scheduled Pinned Locked Moved Support
    24 Posts 4 Posters 68 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.
    • atrippA Offline
      atripp inedo-engineer
      last edited by

      Thanks @scroak_6473; I found the email, and can see a lot of information from what you sent.

      I can clearly see the identical api challenge/response, and the different behaviors from ProGet.

      Unfortunately, I'm not able to reproduce the scenario on this end, using our own instance and a domain impersonated account. But I think that's because this issue may have already been fixed with PG-1859; would you be able to upgrade to 5.3.22 to confirm?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        scroak_6473 @atripp
        last edited by

        Hi @atripp,

        Unfortunately the error still persists in v5.3.22.

        Simon

        atrippA 1 Reply Last reply Reply Quote 0
        • atrippA Offline
          atripp inedo-engineer @scroak_6473
          last edited by

          @scroak_6473 is it the exact same message? Basically, the "api" user not found in the directory?

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            scroak_6473 @atripp
            last edited by

            Hi @atripp

            I actually get a regular 500 error now when I attempt to access using a browser (no fancy Proget 500 error)

            32f2121f-aa77-4370-93fd-89bc22cb37a2-image.png

            I've been able to get some additional logs from our container. I've emailed them to you

            Thanks

            Simon

            1 Reply Last reply Reply Quote 0
            • atrippA Offline
              atripp inedo-engineer
              last edited by

              Hi Simon,

              That is strange, it's basically your browser "hiding" the underlying error. Sometimes that happens if the response body is too short.... which could happen if the server got in some really bizare state.

              I could find the logs you sent, but they were very random and they also don't make sense; it's random ASP.NET errors, but we can't see the full situation. In general the 500 errors should be logged in ProGet > Admin; this will provide a stack trace as to what errors are happening.

              If you can't get to the admin page, then something is really wrong with the server. I would try restrating your container.

              Alana

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                scroak_6473 @atripp
                last edited by

                Hi @atripp,

                There are no logs under the admin page that relate to this error that I could see, additionally when I get this 500 error just for this page the rest of the proget server is fine no 500 errors.

                Is there any way we can do a call or screenshare for you to look at this issue? It's preventing me from using ProGet for some additional integrations.

                During the call I have access to splunk logging and DynaTrace diagnostic tools I can show you.

                Thanks

                Simon

                1 Reply Last reply Reply Quote 0
                • S Offline
                  Stephen.Schaff
                  last edited by Stephen.Schaff

                  I looked into this a bit with one of my impersonations that was working fine.

                  When I do a docker login with a username of "api" and the api key, it works just fine. When I looked at how mine was setup compared to yours, I noticed that you have your user listed "email style". (CMSProxy@YourDomain.com). Mine just has a username (no @domain.com).

                  Curious, I added my domain to mine to see what would happen and when I did I got the following error:

                  error parsing HTTP 403 response body: invalid character '<' looking for beginning of value

                  This seemed similar to what you got, though I also got a lot of HTML that you did not get.

                  Still, it might not hurt to try using the actual username (as defined in your LDAP) instead of the email address. It is very likely just CMSProxy. (If you have already tried this, then I apologize for adding noise to this conversation.)

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    scroak_6473 @Stephen.Schaff
                    last edited by

                    Hey @Stephen-Schaff

                    Thanks for the suggestion. I have tried removing the @yourdomain.com piece from the impersonate field and i'm still having the same issue.

                    Curious what version of proget are you running? are you running it in a container?

                    Thanks

                    Simon

                    atrippA 1 Reply Last reply Reply Quote 0
                    • atrippA Offline
                      atripp inedo-engineer @scroak_6473
                      last edited by

                      @scroak_6473 we could definitely try a screen share, but in a case like this (where we have no idea what's wrong), it's mostly digging in the code and trying to think of things to try to get a clue for more information. Currently, I'm at a loss... because the error you have shouldn't be happening, but it clearly is.

                      So now, I had a new idea. I would like to eliminate Docker from equation, as it handles the
                      "api" username slightly differently than everywhere else. Plus you can do this all in your browser.

                      Can you try to visit a restricted (i.e. not anonymous view) NuGet endpoint using the "api" user name, and a password?

                      For example, it should look like /nuget/NuGetLibraries/v3/index.json, and then your browser should prompt for a Username/Password.

                      Depending on the result of this, we will explore different code paths, and then might need to add some more debugging codes.

                      Best,
                      Alana

                      S 1 Reply Last reply Reply Quote 1
                      • S Offline
                        scroak_6473 @atripp
                        last edited by

                        Hi @atripp,

                        A nuget feed is actually the endpoint i've been testing on since I upgraded to v5.3.22 and sent you the logs via email, i've been able to extract the same logs in an easier to read format, do this help?

                        • You can see my original GET request to "http://proget.xxxxxxxx.com/nuget/nuget-inntopia/v3/index.json" in the second log line below

                        • Then the exception "'Inedo.ProGet.Web.Security.UserNotFoundException'"

                        • And finally the 500 error being thrown in the last log message

                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb Request starting HTTP/1.1 GET http://proget.xxxxxxxx.com/nuget/nuget-inntopia/v3/index.json - -
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb fail: Microsoft.AspNetCore.Server.Kestrel[13]
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb Connection id "0HM6CBB8CS3D5", Request id "0HM6CBB8CS3D5:00000036": An unhandled exception was thrown by the application.
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb Inedo.ProGet.Web.Security.UserNotFoundException: Exception of type 'Inedo.ProGet.Web.Security.UserNotFoundException' was thrown.
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb at Inedo.ProGet.WebApplication.ProGetHttpModule.AuthorizeRequestAsync(HttpApplication app) in C:\InedoAgent\BuildMasterTemp\192.168.44.60\Temp\_E106466\Src\ProGet.WebApplication\ProGetHttpModule.cs:line 332
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb at Inedo.Web.AhWebMiddleware.InvokeAsync(HttpContext context)
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb at Inedo.Web.AhWebMiddleware.InvokeAsync(HttpContext context)
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb at Inedo.Web.AhWebMiddleware.InvokeAsync(HttpContext context)
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb at Dynatrace.OneAgent.Introspection.Shared.NewAspNetCoreTracingMiddlewareBase`1.Invoke(Context context)
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
                        proget.inedo.com/productimages/inedo/proget:5.3.22@sha256:3c2d2dcac563ec335ebdfb2bd4b9c0b08311b941eed415eb6cad0e49877ac39c/Proget_Server.1.pq13ondxps0li5kutof6qmug7/c53e518d3efb Request finished HTTP/1.1 GET http://proget.xxxxxxx.com/nuget/nuget-inntopia/v3/index.json - - - 500 0 - 30.1883ms
                        

                        Also Dynatrace is also showing this, does that help?

                        4b0cd15c-a97a-4515-b6d0-48b9e00e88f1-image.png

                        3936e00f-b9eb-47f5-8806-f35383f77744-image.png

                        e6bc8eee-2f98-4764-a621-9cbc0e49042c-image.png

                        Again I can show you Dynatrace in more detail if we can setup a screenshare.

                        atrippA 2 Replies Last reply Reply Quote 0
                        • atrippA Offline
                          atripp inedo-engineer @scroak_6473
                          last edited by

                          @scroak_6473 this is very helpful actually, thank you!

                          There might be a relation to the LdapReferalException here, so we're going to do some more research and try to suggest what to try next. It might involve some new code (and potentially an upgrade).

                          Please stay tuned...

                          1 Reply Last reply Reply Quote 0
                          • atrippA Offline
                            atripp inedo-engineer @scroak_6473
                            last edited by

                            @scroak_6473 sorry but this one is just really tough and we didn't get the chance to dig in deeper, we're still trying to find time as a team to figure it out

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              scroak_6473 @atripp
                              last edited by

                              Thanks for the update @atripp

                              I await you're fix for this one. Let me know if I can be of anymore assistance.

                              Thanks

                              Simon

                              atrippA 1 Reply Last reply Reply Quote 0
                              • atrippA Offline
                                atripp inedo-engineer
                                last edited by

                                @scroak_6473 thanks again for all the stack traces and help

                                Good news, we finally were able to track this down. It seems to impact .NET5 only (i.e. ProGet for Linux), and involves using impersonation with a somewhat "faulty" LDAP setup (like yours, with those expected referral errors).

                                There's an easy fix, and it involves a small library change on our end. We will get it in the next maintence release of ProGet, but I don't have the issue numbers off hand yet.

                                1 Reply Last reply Reply Quote 0
                                • atrippA Offline
                                  atripp inedo-engineer @scroak_6473
                                  last edited by

                                  @scroak_6473 FYI, this has been fixed in our library (ILIB-115) and we plan to upgrade to that library version via PG-1902 in the next maintence release -- so this should be fixed in 5.3.24, scheduled for the Friday the 5th

                                  If you'd like a pre-release let us know, and we can let you know when it's merged in so you can use it sooner.

                                  S 2 Replies Last reply Reply Quote 0
                                  • S Offline
                                    scroak_6473 @atripp
                                    last edited by

                                    Awesome thanks @atripp

                                    I'll wait for the 5.3.24 release. I'll let you know how testing goes!

                                    Thanks

                                    Simon

                                    1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      scroak_6473 @atripp
                                      last edited by

                                      Hi @atripp

                                      Just to let you know that I just upgraded version 5.3.24 and can confirm that this issue is now resolved!

                                      Thanks so much for all your help!

                                      Thanks

                                      Simon

                                      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
                                      • 1
                                      • 2
                                      • 1 / 2
                                      • First post
                                        Last post
                                      Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation