Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Sasmito Adibowo
2011-01-07 18:57:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
85199a51cfafa8275e3161a495845edb637101ea
85199a51
1 parent
415e3286
Support for HTTP Proxy authentication via NTLM
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
Classes/ASIHTTPRequest.m
Classes/ASIHTTPRequest.m
View file @
85199a5
...
...
@@ -2403,6 +2403,30 @@ static NSOperationQueue *sharedQueue = nil;
// If we have a username and password, let's apply them to the request and continue
if
(
user
&&
pass
)
{
// --- BEGIN adib 7-Jan-2011
// set domain for NTLM
{
NSString
*
authScheme
=
[
self
proxyAuthenticationScheme
];
if
([
authScheme
isEqualToString
:(
NSString
*
)
kCFHTTPAuthenticationSchemeNTLM
])
{
NSString
*
ntlmDomain
=
[
self
proxyDomain
];
if
(
!
ntlmDomain
||
[
ntlmDomain
length
]
==
0
)
{
// try to extract the domain from the user name if its in the form DOMAIN\username
NSArray
*
ntlmComponents
=
[
user
componentsSeparatedByString
:
@"
\\
"
];
if
(
ntlmComponents
.
count
==
2
)
{
NSString
*
domainName
=
[
ntlmComponents
objectAtIndex
:
0
];
NSString
*
userName
=
[
ntlmComponents
objectAtIndex
:
1
];
user
=
userName
;
ntlmDomain
=
domainName
;
}
}
if
(
ntlmDomain
)
{
[
newCredentials
setObject
:
ntlmDomain
forKey
:
(
NSString
*
)
kCFHTTPAuthenticationAccountDomain
];
}
}
}
// --- END adib 7-Jan-2011
[
newCredentials
setObject
:
user
forKey
:(
NSString
*
)
kCFHTTPAuthenticationUsername
];
[
newCredentials
setObject
:
pass
forKey
:(
NSString
*
)
kCFHTTPAuthenticationPassword
];
...
...
Please
register
or
login
to post a comment