Re: URLSession:didReceiveChallenge: does not seem to work for Basic Auth
Re: URLSession:didReceiveChallenge: does not seem to work for Basic Auth
- Subject: Re: URLSession:didReceiveChallenge: does not seem to work for Basic Auth
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 12 Jul 2016 10:47:56 +0100
On 7 Jul 2016, at 08:44, Alexander von Below <email@hidden> wrote:
> Or is the server behaving oddly?
Probably.
I’ve seen this before and it’s always been the result of the server not implementing HTTP authentication properly. The way this is supposed to work is:
1. client makes a request without authentication
2. server responds with 401 with the challenge in the WWW-Authenticate header
3. client retries the request with an Authentication header
4. server accepts the request
What I’ve seen in the past is servers that ignore this design and require the client to include the Authentication header on the first request.
You can confirm this by looking at the traffic on the ‘wire’. The following DevForums post describes various approaches for doing that.
<https://forums.developer.apple.com/thread/38886>
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden