Ben Copsey

Start auth dialog work

//
// ASIAuthenticationDialog.h
// iPhone
//
// Created by Ben Copsey on 21/08/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
@class ASIHTTPRequest;
typedef enum _ASIAuthenticationType {
ASIStandardAuthenticationType = 0,
ASIProxyAuthenticationType = 1
} ASIAuthenticationType;
@interface ASIAuthenticationDialog : NSObject <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> {
ASIHTTPRequest *request;
UIActionSheet *loginDialog;
ASIAuthenticationType type;
}
+ (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request;
+ (void)presentProxyAuthenticationDialogForRequest:(ASIHTTPRequest *)request;
@property (retain) ASIHTTPRequest *request;
@property (retain) UIActionSheet *loginDialog;
@property (assign) ASIAuthenticationType type;
@end
... ...
//
// ASIAuthenticationDialog.m
// iPhone
//
// Created by Ben Copsey on 21/08/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import "ASIAuthenticationDialog.h"
#import "ASIHTTPRequest.h"
ASIAuthenticationDialog *sharedDialog = nil;
NSLock *dialogLock = nil;
@interface ASIAuthenticationDialog ()
- (void)show;
@end
@implementation ASIAuthenticationDialog
+ (void)initialize
{
if (self == [ASIAuthenticationDialog class]) {
dialogLock = [[NSLock alloc] init];
}
}
+ (void)presentProxyAuthenticationDialogForRequest:(ASIHTTPRequest *)request
{
[dialogLock lock];
[sharedDialog release];
sharedDialog = [[self alloc] init];
[sharedDialog setRequest:request];
[sharedDialog setType:ASIProxyAuthenticationType];
[sharedDialog show];
[dialogLock unlock];
}
+ (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request
{
[dialogLock lock];
[sharedDialog release];
sharedDialog = [[self alloc] init];
[sharedDialog setRequest:request];
[sharedDialog show];
[dialogLock unlock];
}
- (void)show
{
// Create an action sheet to show the login dialog
[self setLoginDialog:[[[UIActionSheet alloc] init] autorelease]];
[[self loginDialog] setActionSheetStyle:UIActionSheetStyleBlackOpaque];
[[self loginDialog] setDelegate:self];
// We show the login form in a table view, similar to Safari's authentication dialog
UITableView *table = [[[UITableView alloc] initWithFrame:CGRectMake(0,50,320,480) style:UITableViewStyleGrouped] autorelease];
[table setDelegate:self];
[table setDataSource:self];
[[self loginDialog] addSubview:table];
[[self loginDialog] showInView:[[[UIApplication sharedApplication] windows] objectAtIndex:0]];
[[self loginDialog] setFrame:CGRectMake(0,0,320,480)];
UIToolbar *toolbar = [[[UIToolbar alloc] initWithFrame:CGRectMake(0,0,320,80)] autorelease];
//[toolbar setFrame:CGRectMake(0,20,320,50)];
NSMutableArray *items = [[[NSMutableArray alloc] init] autorelease];
UIBarButtonItem *backButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelAuthenticationFromDialog:)] autorelease];
//[backButton setContentEdgeInsets:UIEdgeInsetsMake(0,20,0,0)];
[items addObject:backButton];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,170,50)];
[label setText:[[[self request] url] host]];
[label setTextColor:[UIColor whiteColor]];
[label setFont:[UIFont boldSystemFontOfSize:22.0]];
[label setShadowColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]];
[label setShadowOffset:CGSizeMake(0, -1.0)];
[label setOpaque:NO];
[label setBackgroundColor:nil];
[label setTextAlignment:UITextAlignmentCenter];
[toolbar addSubview:label];
UIBarButtonItem *labelButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:nil action:nil] autorelease];
//[labelButton setCustomView:label];
//[items addObject:labelButton];
[items addObject:[[[UIBarButtonItem alloc] initWithTitle:@"Login" style:UIBarButtonItemStyleDone target:self action:@selector(loginWithCredentialsFromDialog:)] autorelease]];
[toolbar setItems:items];
[[self loginDialog] addSubview:toolbar];
}
- (void)cancelAuthenticationFromDialog:(id)sender
{
[[self request] cancelAuthentication];
[[self loginDialog] dismissWithClickedButtonIndex:0 animated:YES];
}
- (void)loginWithCredentialsFromDialog:(id)sender
{
[[self request] setUsername:[[[[[[[self loginDialog] subviews] objectAtIndex:0] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]] subviews] objectAtIndex:2] text]];
[[self request] setPassword:[[[[[[[self loginDialog] subviews] objectAtIndex:0] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]] subviews] objectAtIndex:2] text]];
[[self loginDialog] dismissWithClickedButtonIndex:1 animated:YES];
[[self request] retryWithAuthentication];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
NSString *scheme = ([self type] == ASIStandardAuthenticationType) ? [[self request] authenticationScheme] : [[self request] proxyAuthenticationScheme];
if ([scheme isEqualToString:(NSString *)kCFHTTPAuthenticationSchemeNTLM]) {
return 3;
}
return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
if (section == [self numberOfSectionsInTableView:tableView]-1) {
return 30;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 0) {
return 30;
}
return 0;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if (section == 0) {
return [[self request] authenticationRealm];
}
return nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
UITextField *textField = [[[UITextField alloc] initWithFrame:CGRectMake(20,12,260,25)] autorelease];
if ([indexPath section] == 0) {
[textField setPlaceholder:@"User"];
} else if ([indexPath section] == 1) {
[textField setPlaceholder:@"Password"];
} else if ([indexPath section] == 2) {
[textField setPlaceholder:@"Domain"];
}
[cell addSubview:textField];
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
if (section == [self numberOfSectionsInTableView:tableView]-1) {
if ([[[[self request] url] scheme] isEqualToString:@"https"]) {
return @"Password will be sent securely.";
} else {
return @"Password will be sent in the clear.";
}
}
return nil;
}
@synthesize request;
@synthesize loginDialog;
@synthesize type;
@end
... ...
... ... @@ -160,8 +160,8 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
// Used during NTLM authentication
int authenticationRetryCount;
// Authentication method (Basic, Digest, NTLM)
NSString *authenticationMethod;
// Authentication scheme (Basic, Digest, NTLM)
NSString *authenticationScheme;
// Realm for authentication when credentials are required
NSString *authenticationRealm;
... ... @@ -169,6 +169,16 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
// And now, the same thing, but for authenticating proxies
BOOL needsProxyAuthentication;
// When YES, ASIHTTPRequest will present a dialog allowing users to enter credentials when no-matching credentials were found for a server that requires authentication
// The dialog will not be shown if your delegate responds to authenticationNeededForRequest:
// Default is NO.
BOOL shouldPresentAuthenticationDialog;
// When YES, ASIHTTPRequest will present a dialog allowing users to enter credentials when no-matching credentials were found for a proxy server that requires authentication
// The dialog will not be shown if your delegate responds to proxyAuthenticationNeededForRequest:
// Default is YES (basically, because most people won't want the hassle of adding support for authenticating proxies to their apps)
BOOL shouldPresentProxyAuthenticationDialog;
// Used for proxy authentication
CFHTTPAuthenticationRef proxyAuthentication;
NSMutableDictionary *proxyCredentials;
... ... @@ -176,8 +186,8 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
// Used during authentication with an NTLM proxy
int proxyAuthenticationRetryCount;
// Authentication method for the proxy (Basic, Digest, NTLM)
NSString *proxyAuthenticationMethod;
// Authentication scheme for the proxy (Basic, Digest, NTLM)
NSString *proxyAuthenticationScheme;
// Realm for proxy authentication when credentials are required
NSString *proxyAuthenticationRealm;
... ... @@ -378,6 +388,9 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
// Should be called by delegates when they have populated the authentication information after an authentication challenge
- (void)retryWithAuthentication;
// Should be called by delegates when they wish to cancel authentication and stop
- (void)cancelAuthentication;
// Apply authentication information and resume the request after an authentication challenge
- (void)attemptToApplyCredentialsAndResume;
- (void)attemptToApplyProxyCredentialsAndResume;
... ... @@ -484,6 +497,10 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
+ (void)reachabilityChanged:(NSNotification *)note;
#endif
- (BOOL)showProxyAuthenticationDialog;
- (BOOL)showAuthenticationDialog;
+ (unsigned long)maxUploadReadLength;
@property (retain) NSString *username;
... ... @@ -546,4 +563,8 @@ extern unsigned long const ASIWWANBandwidthThrottleAmount;
@property (assign) BOOL shouldCompressRequestBody;
@property (assign) BOOL needsProxyAuthentication;
@property (retain) NSURL *PACurl;
@property (retain) NSString *authenticationScheme;
@property (retain) NSString *proxyAuthenticationScheme;
@property (assign) BOOL shouldPresentAuthenticationDialog;
@property (assign) BOOL shouldPresentProxyAuthenticationDialog;
@end
... ...
... ... @@ -18,6 +18,7 @@
#import <SystemConfiguration/SystemConfiguration.h>
#endif
#import "ASIInputStream.h"
#import "ASIAuthenticationDialog.h"
// We use our own custom run loop mode as CoreAnimation seems to want to hijack our threads otherwise
static CFStringRef ASIHTTPRequestRunMode = CFSTR("ASIHTTPRequest");
... ... @@ -77,6 +78,8 @@ BOOL shouldThrottleBandwithForWWANOnly = NO;
static NSLock *sessionCookiesLock = nil;
UIActionSheet *loginDialog = nil;
// Private stuff
@interface ASIHTTPRequest ()
... ... @@ -196,14 +199,14 @@ static NSLock *sessionCookiesLock = nil;
[password release];
[domain release];
[authenticationRealm release];
[authenticationMethod release];
[authenticationScheme release];
[requestCredentials release];
[proxyHost release];
[proxyUsername release];
[proxyPassword release];
[proxyDomain release];
[proxyAuthenticationRealm release];
[proxyAuthenticationMethod release];
[proxyAuthenticationScheme release];
[proxyCredentials release];
[url release];
[authenticationLock release];
... ... @@ -1401,24 +1404,44 @@ static NSLock *sessionCookiesLock = nil;
return nil;
}
// Called by delegate to resume loading once authentication info has been populated
// Called by delegate or authentication dialog to resume loading once authentication info has been populated
- (void)retryWithAuthentication
{
[[self authenticationLock] lockWhenCondition:1];
[[self authenticationLock] unlockWithCondition:2];
}
// Called by delegate or authentication dialog to cancel authentication
- (void)cancelAuthentication
{
[self failWithError:ASIAuthenticationError];
[[self authenticationLock] lockWhenCondition:1];
[[self authenticationLock] unlockWithCondition:2];
}
- (BOOL)showProxyAuthenticationDialog
{
if ([self shouldPresentProxyAuthenticationDialog]) {
[ASIAuthenticationDialog performSelectorOnMainThread:@selector(presentProxyAuthenticationDialogForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]];
[[self authenticationLock] lockWhenCondition:2];
[[self authenticationLock] unlockWithCondition:1];
return YES;
}
return NO;
}
- (BOOL)askDelegateForProxyCredentials
{
// If we have a delegate, we'll see if it can handle proxyAuthorizationNeededForRequest:.
// If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:.
// Otherwise, we'll try the queue (if this request is part of one) and it will pass the message on to its own delegate
id authorizationDelegate = [self delegate];
if (!authorizationDelegate) {
authorizationDelegate = [self queue];
id authenticationDelegate = [self delegate];
if (!authenticationDelegate) {
authenticationDelegate = [self queue];
}
if ([authorizationDelegate respondsToSelector:@selector(proxyAuthorizationNeededForRequest:)]) {
[authorizationDelegate performSelectorOnMainThread:@selector(proxyAuthorizationNeededForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]];
if ([authenticationDelegate respondsToSelector:@selector(proxyAuthenticationNeededForRequest:)]) {
[authenticationDelegate performSelectorOnMainThread:@selector(proxyAuthenticationNeededForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]];
[[self authenticationLock] lockWhenCondition:2];
[[self authenticationLock] unlockWithCondition:1];
... ... @@ -1430,12 +1453,16 @@ static NSLock *sessionCookiesLock = nil;
- (void)attemptToApplyProxyCredentialsAndResume
{
if ([self error]) {
return;
}
// Read authentication data
if (!proxyAuthentication) {
CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty(readStream,kCFStreamPropertyHTTPResponseHeader);
proxyAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader);
CFRelease(responseHeader);
proxyAuthenticationMethod = (NSString *)CFHTTPAuthenticationCopyMethod(proxyAuthentication);
[self setProxyAuthenticationScheme:[(NSString *)CFHTTPAuthenticationCopyMethod(proxyAuthentication) autorelease]];
}
// If we haven't got a CFHTTPAuthenticationRef by now, something is badly wrong, so we'll have to give up
... ... @@ -1472,11 +1499,11 @@ static NSLock *sessionCookiesLock = nil;
if (proxyCredentials) {
// We use startRequest rather than starting all over again in load request because NTLM requires we reuse the request
if (((proxyAuthenticationMethod != (NSString *)kCFHTTPAuthenticationSchemeNTLM) || proxyAuthenticationRetryCount < 2) && [self applyCredentials:proxyCredentials]) {
if ((([self proxyAuthenticationScheme] != (NSString *)kCFHTTPAuthenticationSchemeNTLM) || proxyAuthenticationRetryCount < 2) && [self applyCredentials:proxyCredentials]) {
[self startRequest];
// We've failed NTLM authentication twice, we should assume our credentials are wrong
} else if (proxyAuthenticationMethod == (NSString *)kCFHTTPAuthenticationSchemeNTLM && proxyAuthenticationRetryCount == 2) {
} else if ([self proxyAuthenticationScheme] == (NSString *)kCFHTTPAuthenticationSchemeNTLM && proxyAuthenticationRetryCount == 2) {
[self failWithError:ASIAuthenticationError];
// Something went wrong, we'll have to give up
... ... @@ -1505,24 +1532,39 @@ static NSLock *sessionCookiesLock = nil;
return;
}
// The delegate isn't interested, we'll have to give up
if ([self showProxyAuthenticationDialog]) {
[self attemptToApplyProxyCredentialsAndResume];
}
// The delegate isn't interested and we aren't showing the authentication dialog, we'll have to give up
[self failWithError:ASIAuthenticationError];
return;
}
}
- (BOOL)showAuthenticationDialog
{
if ([self shouldPresentAuthenticationDialog]) {
[ASIAuthenticationDialog performSelectorOnMainThread:@selector(presentAuthenticationDialogForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]];
[[self authenticationLock] lockWhenCondition:2];
[[self authenticationLock] unlockWithCondition:1];
return YES;
}
return NO;
}
- (BOOL)askDelegateForCredentials
{
// If we have a delegate, we'll see if it can handle proxyAuthorizationNeededForRequest:.
// If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:.
// Otherwise, we'll try the queue (if this request is part of one) and it will pass the message on to its own delegate
id authorizationDelegate = [self delegate];
if (!authorizationDelegate) {
authorizationDelegate = [self queue];
id authenticationDelegate = [self delegate];
if (!authenticationDelegate) {
authenticationDelegate = [self queue];
}
if ([authorizationDelegate respondsToSelector:@selector(authorizationNeededForRequest:)]) {
[authorizationDelegate performSelectorOnMainThread:@selector(authorizationNeededForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]];
if ([authenticationDelegate respondsToSelector:@selector(authenticationNeededForRequest:)]) {
[authenticationDelegate performSelectorOnMainThread:@selector(authenticationNeededForRequest:) withObject:self waitUntilDone:[NSThread isMainThread]];
[[self authenticationLock] lockWhenCondition:2];
[[self authenticationLock] unlockWithCondition:1];
... ... @@ -1533,6 +1575,10 @@ static NSLock *sessionCookiesLock = nil;
- (void)attemptToApplyCredentialsAndResume
{
if ([self error]) {
return;
}
if ([self needsProxyAuthentication]) {
[self attemptToApplyProxyCredentialsAndResume];
return;
... ... @@ -1543,7 +1589,7 @@ static NSLock *sessionCookiesLock = nil;
CFHTTPMessageRef responseHeader = (CFHTTPMessageRef) CFReadStreamCopyProperty(readStream,kCFStreamPropertyHTTPResponseHeader);
requestAuthentication = CFHTTPAuthenticationCreateFromResponse(NULL, responseHeader);
CFRelease(responseHeader);
authenticationMethod = (NSString *)CFHTTPAuthenticationCopyMethod(requestAuthentication);
[self setAuthenticationScheme:[(NSString *)CFHTTPAuthenticationCopyMethod(requestAuthentication) autorelease]];
}
if (!requestAuthentication) {
... ... @@ -1570,6 +1616,9 @@ static NSLock *sessionCookiesLock = nil;
[self attemptToApplyCredentialsAndResume];
return;
}
if ([self showAuthenticationDialog]) {
[self attemptToApplyCredentialsAndResume];
}
}
[self cancelLoad];
[self failWithError:ASIAuthenticationError];
... ... @@ -1580,11 +1629,11 @@ static NSLock *sessionCookiesLock = nil;
if (requestCredentials) {
if (((authenticationMethod != (NSString *)kCFHTTPAuthenticationSchemeNTLM) || authenticationRetryCount < 2) && [self applyCredentials:requestCredentials]) {
if ((([self authenticationScheme] != (NSString *)kCFHTTPAuthenticationSchemeNTLM) || authenticationRetryCount < 2) && [self applyCredentials:requestCredentials]) {
[self startRequest];
// We've failed NTLM authentication twice, we should assume our credentials are wrong
} else if (authenticationMethod == (NSString *)kCFHTTPAuthenticationSchemeNTLM && authenticationRetryCount == 2) {
} else if ([self authenticationScheme] == (NSString *)kCFHTTPAuthenticationSchemeNTLM && authenticationRetryCount == 2) {
[self failWithError:ASIAuthenticationError];
} else {
... ... @@ -1612,8 +1661,9 @@ static NSLock *sessionCookiesLock = nil;
return;
}
// The delegate isn't interested, we'll have to give up
[self failWithError:ASIAuthenticationError];
if ([self showAuthenticationDialog]) {
[self attemptToApplyCredentialsAndResume];
}
return;
}
... ... @@ -2498,6 +2548,7 @@ static NSLock *sessionCookiesLock = nil;
return toRead;
}
@synthesize username;
@synthesize password;
@synthesize domain;
... ... @@ -2572,6 +2623,10 @@ static NSLock *sessionCookiesLock = nil;
@synthesize proxyHost;
@synthesize proxyPort;
@synthesize PACurl;
@synthesize authenticationScheme;
@synthesize proxyAuthenticationScheme;
@synthesize shouldPresentAuthenticationDialog;
@synthesize shouldPresentProxyAuthenticationDialog;
@end
... ...
... ... @@ -13,6 +13,7 @@
@interface AuthenticationViewController : UIViewController {
ASINetworkQueue *networkQueue;
IBOutlet UISwitch *useKeychain;
IBOutlet UISwitch *useBuiltInDialog;
IBOutlet UILabel *topSecretInfo;
ASIHTTPRequest *requestRequiringAuthentication;
ASIHTTPRequest *requestRequiringProxyAuthentication;
... ...
... ... @@ -27,6 +27,7 @@
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/top_secret/"]];
[request setUseKeychainPersistance:[useKeychain isOn]];
[request setShouldPresentAuthenticationDialog:[useBuiltInDialog isOn]];
[networkQueue addOperation:request];
[networkQueue go];
... ... @@ -44,28 +45,31 @@
[topSecretInfo setFont:[UIFont boldSystemFontOfSize:12]];
}
- (void)authorizationNeededForRequest:(ASIHTTPRequest *)request
{
// Why oh why is there no contextInfo for alertView like on Mac OS ?!
[self setRequestRequiringProxyAuthentication:nil];
[self setRequestRequiringAuthentication:request];
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Please Login" message:[request authenticationRealm] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil] autorelease];
// These are undocumented, use at your own risk!
// A better general approach would be to subclass UIAlertView
[alertView addTextFieldWithValue:@"" label:@"Username"];
[alertView addTextFieldWithValue:@"" label:@"Password"];
[alertView show];
}
- (void)proxyAuthorizationNeededForRequest:(ASIHTTPRequest *)request
{
[self setRequestRequiringAuthentication:nil];
[self setRequestRequiringProxyAuthentication:request];
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Please Login to proxy" message:[request authenticationRealm] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil] autorelease];
[alertView addTextFieldWithValue:@"" label:@"Username"];
[alertView addTextFieldWithValue:@"" label:@"Password"];
[alertView show];
}
//- (void)authorizationNeededForRequest:(ASIHTTPRequest *)request
//{
// // Why oh why is there no contextInfo for alertView like on Mac OS ?!
// [self setRequestRequiringProxyAuthentication:nil];
// [self setRequestRequiringAuthentication:request];
//
// [ASIHTTPRequest showAuthenticationDialogForRequest:request];
//
// //UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Please Login" message:[request authenticationRealm] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil] autorelease];
// // These are undocumented, use at your own risk!
// // A better general approach would be to subclass UIAlertView
// //[alertView addTextFieldWithValue:@"" label:@"Username"];
// //[alertView addTextFieldWithValue:@"" label:@"Password"];
//
//}
//
//- (void)proxyAuthorizationNeededForRequest:(ASIHTTPRequest *)request
//{
// [self setRequestRequiringAuthentication:nil];
// [self setRequestRequiringProxyAuthentication:request];
// UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Please Login to proxy" message:[request authenticationRealm] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil] autorelease];
// [alertView addTextFieldWithValue:@"" label:@"Username"];
// [alertView addTextFieldWithValue:@"" label:@"Password"];
// [alertView show];
//}
... ...
This diff is collapsed. Click to expand it.
This diff was suppressed by a .gitattributes entry.