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!

    How do I correctly pass username / password to a security protected Maven feed?

    Scheduled Pinned Locked Moved Support
    progetjavaauthentication
    3 Posts 1 Posters 82 Views
    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.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I have Proget set up with a user called "Jenkins" which is in the group "Pushers" which has permissions for the default tasks of Publish Packages and Promote Packages. This succeeded once (at least I think so, I'm not 100% sure if it succeeded while it was just under password control), but then I wanted to change the password so I deleted and recreated the user and made sure everything was OK again. However, now all pushes fail with:

      Upload http://172.23.121.218:8080/maven2/internalmaven/com/couchbase/lite/couchbase-lite-android/2.0.0-SNAPSHOT/couchbase-lite-android-2.0.0-20170328.002044-1-javadoc.jar
      Could not transfer artifact com.couchbase.lite:couchbase-lite-android:jar:javadoc:2.0.0-20170328.002044-1 from/to remote (http://<user>:<pass>@172.23.121.218:8080/maven2/internalmaven): Could not write to resource 'com/couchbase/lite/couchbase-lite-android/2.0.0-SNAPSHOT/couchbase-lite-android-2.0.0-20170328.002044-1-javadoc.jar'

      I have recreated the group and user numerous times, as well as giving permission explicitly to the user. None of these has solved the problem. If I add anonymous access, then both the password URL and the non-password URL work for pushing. Is there a way to find more information about what went wrong? Is HTTP Basic Auth the incorrect way to do this?

      Product: ProGet
      Version: 4.7.4

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        I'm not sure... the easiest way to debug this would be to attach a proxy server to ProGet; just configure ProGet to go through a Fiddler instance installed on the server.

        Maven only (generally) supports basic authentication, that is unless you want to do a custom "wheel", which we haven't heard of many folks having success with.

        If the anonymous user can access a feed, then there is no 401-challenge. In this case, the client is likely not sending any credentials (you should only send credentials when asked).

        So, my guess is that your authentication credentials are being cached. That would explain the behavior of working, and then not working.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Ok I figured out what I was doing wrong. I was setting the URL in build.gradle to:

          http://<user>:<password>@proget-server

          But it should look like this instead

          publishing {
          repositories {
          maven {
          credentials {
          username "$mavenUser"
          password "$mavenPassword"
          }
          url "http://proget-server"
          }
          }
          }

          With the mavenUser and mavenPassword being defined in ~/.gradle/gradle.properties

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