-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Different behavior of HttpClient depending on OS. Digest authentication #101787
Comments
Tagging subscribers to this area: @dotnet/ncl |
I think it may be the platform handler. Can you try it with |
Yes, this fixed the bug... |
well, not really but at least you have something to work with. I'll leave it open for iOS folks to look at it. |
@vitek-karas @kotlarmilos can you please triage this iOS issue? Thanks! |
@simonrozsival can you please take a look? |
As far as I can tell, Digest auth is not implemented in the iOS platform handler (unlike it is in the managed |
If easy we can perhaps share implementation. Digest is not considered secure as it depends on long deprecated |
Description
HttpClient with Digest auth is working fine in
.net8
console app. Onnet8-ios
requests are failing withStatus 401
. I attached repository with the code to reproduce (see below).Reproduction Steps
Let's say we have a service that is working with
httpbin.org
site with Digest auth.This code will work fine in console apps but will fail in iOS/Android app with
401
status codeExpected behavior
Digest auth should work (or not work) the same way on every OS supported by modern
net8
. In this case I expect code200
in console app and in mobile apps.Actual behavior
Digest auth work in console app and doesn't work in mobile apps (iOS/Android)
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
See https://github.com/Paul-N/DigestAuthDemo repository. It consist of 3 projects. They all have a service
interface IHttpBinService
that is working with httpbin.org website. The projects are:net8
console app,net8-ios
iOS app (no MAUI, just basic native UI to test),Xamarin iOS
app with the same UI.The service
interface IHttpBinService
has two implementations: one with HttpClient and another with NSUrlSession (native iOS way to make a HTTP requests). The console app is able to call only HttpClient based service. The two iOS app can call both implementations.How to test:
DigestAuthDemo.Xamarin_iOS
app, click[HttpClient]
button, response is Ok. Click[Clear]
button. Click[NsUrlSession]
response is also Ok.DigestAuthDemo.Net8_iOS
app, click[HttpClient]
button, response is Error. Click[Clear]
button. Click[NsUrlSession]
response is Ok.DigestAuthDemo.Net8_iOS
and you hit[NsUrlSession]
BEFORE[HttpClient]
button then HttpClient will work fine.The text was updated successfully, but these errors were encountered: