2 Replies Latest reply on Feb 18, 2015 12:06 PM by enricopulatzo

    Authenticated Karaf features:addurl in JBoss Fuse 6.1?

    enricopulatzo

      We use Nexus OSS and have installed the OSGi Bundle Repository (OBR) plugin for it, which produces a karaf bundle metadata XML feed.

       

      Due to our policies, I have configured Nexus to require a login when accessing the repositories which include the OBR plugin's XML feed. I can use a browser to verify that the XML feed is accessible, provided one has logged in.

       

      When I use JBoss Fuse's karaf client, I get an expected HTTP 401 error when attempting to perform features:addurl against the URL from Nexus. I have been unable to configure Karaf to use any sort of authentication.

       

      How can I configure Karaf to provide outbound credentials similar to how I have configured Maven to do so? If I can ideally delegate this to Maven that would be ideal.

       

      Thank you for your time and help.

        • 1. Re: Authenticated Karaf features:addurl in JBoss Fuse 6.1?
          enricopulatzo

          So far it looks as though Karaf can support proxy authentication, but no other types. I really, really hope I'm wrong though.

          • 2. Re: Authenticated Karaf features:addurl in JBoss Fuse 6.1?
            enricopulatzo

            I ended up foregoing the karaf features in favor of just using "osgi:install".

             

            I specified a maven settings file in my org.ops4j.pax.url.mvn.cfg. That maven settings file contained a server section whose ID corresponds to the @id of our Nexus server. I was then able to set the username and password for a local Nexus user in that settings file (optionally using encryption via Maven's password encryption feature).

             

            I then replaced the contents of the key org.ops4j.pax.url.mvn.defaultRepositories in org.ops4j.url.mvn.cfg with the URL of my Nexus server, adding the @id attribute to match the maven server id.

             

            Same thing for the org.ops4j.pax.url.mvn.repositories key.

             

            I configured my Nexus server to proxy the default repositories that Fuse ships with, so that none of the potential install targets would be lost.

             

            Finally, I restarted Fuse. I am now able to use "osgi:install" on maven coordinates for both my first-party bundles and any third-party bundles that I need.