Giter Site home page Giter Site logo

Error code 401 about okhttp-digest HOT 5 CLOSED

rburgst avatar rburgst commented on August 26, 2024
Error code 401

from okhttp-digest.

Comments (5)

rburgst avatar rburgst commented on August 26, 2024
  1. try and use a known working client and capture the http traffic
  2. check com.burgstaller.okhttp.digest.DigestAuthenticatorTest#testWWWAuthenticate__withUriPathAndParameters and inject the observed values into the test and see whether the library creates the correct authorization header.

from okhttp-digest.

GreenSnakeLinux avatar GreenSnakeLinux commented on August 26, 2024

user / password was set with HttpUrlConnection so i switch to OkHttp and now I've got the familiar error :
java.io.IOException: unexpected end of stream
From what I understand the error is from OkHttp, I need to wait a potential correction. I'll stay with HttpUrlConnection in the mean time.

from okhttp-digest.

rburgst avatar rburgst commented on August 26, 2024

As the SO post hints unexpected end of stream means that your server is sending an invalid response with a wrong content-length header. This has nothing to do with authentication.
As stated earlier the best advice I can offer is to capture the http traffic from HttpUrlConnection (i.e. by using a proxy such as Fiddler or CharlesProxy) and then check the difference between the two (i.e. barebones-digest and okhttp-digest).
You can then re-create the problem in the unit test com.burgstaller.okhttp.digest.DigestAuthenticatorTest#testWWWAuthenticate__withUriPathAndParameters.

All that okhttp-digest does is to calculate the correct Authorization header.

from okhttp-digest.

GreenSnakeLinux avatar GreenSnakeLinux commented on August 26, 2024

Ok thanks. Before doing this, is there a way to bypass or override the check lenght since I cannot update the server (it's a Smart TV) ?

from okhttp-digest.

rburgst avatar rburgst commented on August 26, 2024

you would need to check with the okhttp guys. This has nothing to do with okhttp-digest.

from okhttp-digest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.