2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 import "IWebError.idl";
30 import "IWebURLResponse.idl";
34 interface IWebURLAuthenticationChallengeSender;
35 interface IWebURLCredential;
36 interface IWebURLProtectionSpace;
37 interface IWebURLResponse;
40 WebURLCredentialPersistenceNone,
41 WebURLCredentialPersistenceForSession,
42 WebURLCredentialPersistencePermanent
43 } WebURLCredentialPersistence;
48 uuid(5382DABA-C3C3-40c5-AA40-04079F11A844),
49 pointer_default(unique)
51 interface IWebURLAuthenticationChallenge : IUnknown
56 HRESULT error([out, retval] IWebError** result);
59 - (NSURLResponse *)failureResponse
61 HRESULT failureResponse([out, retval] IWebURLResponse** result);
64 - (id)initWithAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge sender:(id<NSURLAuthenticationChallengeSender>)sender
66 HRESULT initWithAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge, [in] IWebURLAuthenticationChallengeSender* sender);
69 - (id)initWithProtectionSpace:(NSURLProtectionSpace *)space proposedCredential:(NSURLCredential *)credential previousFailureCount:(int)count failureResponse:(NSURLResponse *)response error:(NSError *)error sender:(id <NSURLAuthenticationChallengeSender>)sender
71 HRESULT initWithProtectionSpace([in] IWebURLProtectionSpace* space, [in] IWebURLCredential* proposedCredential, [in] int previousFailureCount, [in] IWebURLResponse* failureResponse, [in] IWebError* error, [in] IWebURLAuthenticationChallengeSender* sender);
74 -(unsigned)previousFailureCount
76 HRESULT previousFailureCount([out, retval] UINT* result);
79 -(NSURLCredential *)proposedCredential
81 HRESULT proposedCredential([out, retval] IWebURLCredential** result);
84 - (NSURLProtectionSpace *)protectionSpace
86 HRESULT protectionSpace([out, retval] IWebURLProtectionSpace** result);
89 - (id<NSURLAuthenticationChallengeSender>)sender
91 HRESULT sender([out, retval] IWebURLAuthenticationChallengeSender** sender);
97 uuid(9360D6FB-186C-4ff7-AE57-D1B973DA0D1C),
98 pointer_default(unique)
100 interface IWebURLAuthenticationChallengeSender : IUnknown
103 - (void)cancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
105 HRESULT cancelAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge);
108 - (void)continueWithoutCredentialForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
110 HRESULT continueWithoutCredentialForAuthenticationChallenge([in] IWebURLAuthenticationChallenge* challenge);
113 - (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
115 HRESULT useCredential([in] IWebURLCredential* credential, [in] IWebURLAuthenticationChallenge* challenge);
118 cpp_quote("#define WebURLProtectionSpaceHTTP TEXT(\"http\")")
119 cpp_quote("#define WebURLProtectionSpaceHTTPS TEXT(\"https\")")
120 cpp_quote("#define WebURLProtectionSpaceFTP TEXT(\"ftp\")")
121 cpp_quote("#define WebURLProtectionSpaceFTPS TEXT(\"ftps\")")
122 cpp_quote("#define WebURLProtectionSpaceHTTPProxy TEXT(\"http\")")
123 cpp_quote("#define WebURLProtectionSpaceHTTPSProxy TEXT(\"https\")")
124 cpp_quote("#define WebURLProtectionSpaceFTPProxy TEXT(\"ftp\")")
125 cpp_quote("#define WebURLProtectionSpaceSOCKSProxy TEXT(\"SOCKS\")")
126 cpp_quote("#define WebURLAuthenticationMethodDefault TEXT(\"WebURLAuthenticationMethodDefault\")")
127 cpp_quote("#define WebURLAuthenticationMethodHTTPBasic TEXT(\"WebURLAuthenticationMethodHTTPBasic\")")
128 cpp_quote("#define WebURLAuthenticationMethodHTTPDigest TEXT(\"WebURLAuthenticationMethodHTTPDigest\")")
129 cpp_quote("#define WebURLAuthenticationMethodHTMLForm TEXT(\"WebURLAuthenticationMethodHTMLForm\")")
135 uuid(71D2622A-3FF2-404b-BD45-C60659C901AF),
136 pointer_default(unique)
138 interface IWebURLProtectionSpace : IUnknown
141 -(NSString *)authenticationMethod
143 HRESULT authenticationMethod([out, retval] BSTR* result);
148 HRESULT host([out, retval] BSTR* result);
151 -(id)initWithHost:(NSString *)host port:(int)port protocol:(NSString *)protocol realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod
153 HRESULT initWithHost([in] BSTR host, [in] int port, [in] BSTR protocol, [in] BSTR realm, [in] BSTR authenticationMethod);
156 -(id)initWithProxyHost:(NSString *)host port:(int)port type:(NSString *)proxyType realm:(NSString *)realm authenticationMethod:(NSString *)authenticationMethod
158 HRESULT initWithProxyHost([in] BSTR host, [in] int port, [in] BSTR proxyType, [in] BSTR realm, [in] BSTR authenticationMethod);
163 HRESULT isProxy([out, retval] BOOL* result);
168 HRESULT port([out, retval] int* result);
171 -(NSString *)protocol
173 HRESULT protocol([out, retval] BSTR* result);
176 -(NSString *)proxyType
178 HRESULT proxyType([out, retval] BSTR* result);
183 HRESULT realm([out, retval] BSTR* result);
186 -(BOOL)receivesCredentialSecurely
188 HRESULT receivesCredentialSecurely([out, retval] BOOL* result);
195 uuid(A1E9D765-FACE-4189-BBE3-AED7EBF65EBD),
196 pointer_default(unique)
198 interface IWebURLCredential : IUnknown
203 HRESULT hasPassword([out, retval] BOOL* result);
206 -(id)initWithUser:(NSString *)user password:(NSString *)password persistence:(NSURLCredentialPersistence)persistence
208 HRESULT initWithUser([in] BSTR user, [in] BSTR password, [in] WebURLCredentialPersistence persistence);
211 -(NSString *)password
213 HRESULT password([out, retval] BSTR* password);
216 -(NSURLCredentialPersistence)persistence
218 HRESULT persistence([out, retval] WebURLCredentialPersistence* result);
223 HRESULT user([out, retval] BSTR* result);