diff --git a/JiveAuthenticatingHTTPProtocolDemo/JiveAuthenticatingHTTPProtocolDemo/ViewController.m b/JiveAuthenticatingHTTPProtocolDemo/JiveAuthenticatingHTTPProtocolDemo/ViewController.m index b1805ec..0b4b91a 100644 --- a/JiveAuthenticatingHTTPProtocolDemo/JiveAuthenticatingHTTPProtocolDemo/ViewController.m +++ b/JiveAuthenticatingHTTPProtocolDemo/JiveAuthenticatingHTTPProtocolDemo/ViewController.m @@ -36,7 +36,19 @@ - (void)viewDidLoad { #pragma mark - JAHPAuthenticatingHTTPProtocolDelegate - (BOOL)authenticatingHTTPProtocol:(JAHPAuthenticatingHTTPProtocol *)authenticatingHTTPProtocol canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { - BOOL canAuthenticate = [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodHTTPBasic]; + + NSArray* interceptedAuthMethods = + @[ + NSURLAuthenticationMethodHTTPBasic + , NSURLAuthenticationMethodHTTPDigest + , NSURLAuthenticationMethodNTLM + ]; + + NSSet* interceptedAuthMethodsSet = [NSSet setWithArray: interceptedAuthMethods]; + + BOOL canAuthenticate = + [interceptedAuthMethodsSet containsObject: protectionSpace.authenticationMethod]; + return canAuthenticate; }