Hi Scott, Are you using the Karaf realm?
I'm not sure how the Jetty client is connected to the authentication store. regards, François [email protected] Le 20/06/2019 à 20:23, Leschke, Scott a écrit : > > I realize this isn’t strictly a Karaf question but I’m having trouble > authenticating using the Jetty client in Karaf 4.2.5. I’m getting a > 401 from a server (on a GET) that I’m unable to resolve even though > I’ve verified that the user/pwd I have is correct using both Chrome > and Postman. > > > > The code I’m using to setup the client is as shown below. To the best > of my knowledge this is correct yet I’m still getting a 401. > > Any help on this would be greatly appreciated. > > > > /client/= new HttpClient(new SslContextFactory_(true)_); > > client.start(); > > > > … elsewhere …. > > > > AuthenticationStore auths = /getClient/().getAuthenticationStore(); > > String authRealm = “Any”; > > > > if (auths.findAuthentication("Basic", uri, authRealm) != null) return; > > > > auths.addAuthentication(new BasicAuthentication(uri, authRealm, > “myUserName”, “myPassword”); > > >
