• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strange Authentication Failure

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have some code that is uploading a file to a customers SharePoint server. The SharePoint server requires basic authentication for access so I'm supplying a username and password using an Authenticator.

So far so good but now for the strange part. The code works fine on our production server and it works fine on our test machines but it always, without fail, gives me an authentication failure when run on my development machine. I've looked high and low for what is different about my development machine and I've drawn a blank. I'm hoping someone can give me an idea about where to look next.

A selection of things I've tried: various newly installed versions of the VM both 7 and 8 all failed on my machine but worked on the test machines. I've tested authentication against https://httpbin.org/basic-auth/user/passwd - it worked on my dev machine. I've run with "com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true" to catch the output of the request sent to the server (see below for an example). The username and password supplied in the request are correct and the request looks well formed - I've checked it against the output from a working machine and it's the same.



Exception in thread "main" javax.xml.ws.WebServiceException: java.io.IOException: Authentication failure
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.readResponseCodeAndMessage(HttpClientTransport.java:195)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:226)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:217)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:130)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:124)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:1121)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:1035)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:1004)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:862)
at com.sun.xml.internal.ws.client.Stub.process(Stub.java:448)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:178)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:93)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:77)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:147)
at com.sun.proxy.$Proxy36.copyIntoItems(Unknown Source)
at com.
at com.
at com.
Caused by: java.io.IOException: Authentication failure
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1733)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.readResponseCodeAndMessage(HttpClientTransport.java:191)
... 17 more






The only difference I can see with the output from a working system and a failing system is that the code never calls the authenticator on the failing machine. I've tried debugging into sun.net.www.protocol.http.HttpURLConnection but without much success. There's a ton of code and finding all the required source is nearly impossible. What is interesting is the failure is not a 401 or 403 from the remote machine, this problem seems to be local to my machine. I've torn my hair out for two days over this, just about any suggestion is welcome at this point. Just to be clear: this code works fine everywhere else and it only seems to to be a problem with this one remote server.

 
reply
    Bookmark Topic Watch Topic
  • New Topic