asihttprequest


ASIHTTPRequest authentication needed when not on WiFi, with credentials given


I'm experiencing some strange behavior with the ASIHTTPRequest.
I'm trying to connect to a website which prompt a user to give his/her credentials when loading the page.
To implement this with ASIHTTPRequest i've used the following code:
NSURL *URL = [NSURL URLWithString:#"http://fhict.fontys.nl/Pages/Welkom.aspx"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:URL];
[request setUsername:theUsername];
[request setPassword:thePassword];
[request setDelegate:self];
[request startAsynchronous];
I'm sure the credentials given to the request are correct,
and when i'm working on WiFi the request succeeds and the app continues..
But when i'm connected to cellular network, the exact same request gives an error:
error:Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed" UserInfo=0x2e8ef0 {NSLocalizedDescription=Authentication needed}
I checked, this same error is given when the credentials are incorrect, but i've double checked them and they are correct!
To fix this I've tried:
setting the timeout on 2 minutes (overkill I know but just for testing), this resulted the same error
enabled and set bandwidth throttling for WWAN (as described on http://allseeing-i.com/ASIHTTPRequest/How-to-use, search for WWAN), but nothing changed
setting enabling shouldPresentCredentialsBeforeChallange and adding basichttpheader to the request, but then also WiFi stopped working..
And then a lot of googling later, still no solution.
I'm a little confused because because on WiFi everything works perfectly,
I hope anyone here can point me in the right direction..
(Answered in a question edit. Converted to a community wiki answer. See What is the appropriate action when the answer to a question is added to the question itself? )
The OP wrote:
I got a tip and changed the url to https, this solved all issues! (I'm leaving the question for if someone experiences the same in the future..)

Related Links

Downloading data using ASIHttpRequest
ASINetworkQueue without setting DownloadDestinationPath
I am using ASIHTTPREquest I am geeting some issue in MAc OSx xcode 3.1
What to do now that asihttprequest's owner stopped working on the project?
ASIHttPRequest didReceiveData- how to populate responseData, responseString?
RestKit with ASIHTTPRequest
ASIHTTPRequest backed RestKit object mapping
ASIHTTPRequest begins but never ends
MBProgressHUD with ASIHTTPRequest
ASIHTTPRequest and ASINetworkQueue and JSON Parsing
iOS 5 Hanging on ASIHTTPRequests
ASIHTTPRequest authentication needed when not on WiFi, with credentials given
Get return value within an ASIBasicBlock
ASIHTTPRequest setDownloadDestinationPath crashing
ASIHTTPRequestErrorDomain Code=4 “The request was cancelled”
ASIHttpRequest send a weired status code of zero. Not reaching the server

Categories

HOME
artificial-intelligence
mc
windows-8.1
facebook-messenger
compilation
haproxy
stacktrace.js
loopbackjs
google-play-services
dependencies
biztalk-2010
openflow
amp
wagtail
scrape
xades4j
fireloop
bundler
distributed-computing
reselect
vertica
web-deployment
infrared
bluemix-mobile-services
pe
tableview
weex
backtracking
pymongo
rxjs5
exchange-server-2010
pyopencl
introspection
points
echosign
django-import-export
envoy
xenapp
premake
publishing
commonsware-cwac
epplus
grails-2.5
runtimeexception
strapi
google-now
robust
reverse-dns
cloudwatch
roracle
libreoffice-writer
amazon-elastic-beanstalk
android-webservice
asp.net-web-api-routing
word-2007
deedle
stateless-session-bean
degrees
openerp-6
system.web.optimization
svnserve
between
nsdata
android-4.2-jelly-bean
qpixmap
unsigned
adp
node-glob
vimperator
django-validation
bayesglm
android-mapview
opencyc
blank-line
supercomputers
postal-code
replicaset
green-threads
componentart
shoes
kotlin-android-extensions
tkx
sql-processor
ildasm
qt5.4
visual-c++-2012
windows-messages
django-sites
colon
stty
statechart
cyrillic
email-verification
onconfigurationchanged
mkannotation
delphi-prism
vows
getopts
grails-validation
ognl
servlet-container
nsconnection
reliability
fgetc
wmd-editor
rtti
suggestbox
levels

Resources

Encrypt Message