HTTP Basic Authentication issue on Android Jelly Bean 4.1 using HttpURLConnection

后端 未结 2 1120
一个人的身影
一个人的身影 2020-12-11 05:10

We are making HttpURLConnection based request to the Web server using HTTP Basic Authentication. Code works great on Android versions 2.x, 3.x., 4.0.x Now with Jelly Bean an

2条回答
  •  感情败类
    2020-12-11 05:50

    For a 401 UNAUTHORIZED response with Android's httpURLConnection your server must send back a authenticate header like this...
    WWW-Authenticate: Bogus realm="blahblah", comment="use form to log in"
    as per
    http://tools.ietf.org/html/rfc2616 search "10.4.2 401 Unauthorized"

提交回复
热议问题