CFHTTPAuthentication.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. {
  2. File: CFNetwork/CFHTTPAuthentication.h
  3. Contains: CoreFoundation Network HTTP authentication header
  4. Copyright: Copyright (c) 2001-2008, Apple Inc. All rights reserved.
  5. Bugs?: For bug reports, consult the following page on
  6. the World Wide Web:
  7. http://bugs.freepascal.org
  8. }
  9. { Pascal Translation: Gale R Paeper, <[email protected]>, 2008 }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. { Pascal Translation Updated: Jonas Maebe <[email protected]>, August 2015 }
  13. {
  14. Modified for use with Free Pascal
  15. Version 308
  16. Please report any bugs to <[email protected]>
  17. }
  18. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  19. {$mode macpas}
  20. {$modeswitch cblocks}
  21. {$packenum 1}
  22. {$macro on}
  23. {$inline on}
  24. {$calling mwpascal}
  25. unit CFHTTPAuthentication;
  26. interface
  27. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  28. {$setc GAP_INTERFACES_VERSION := $0308}
  29. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  30. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  31. {$endc}
  32. {$ifc defined CPUPOWERPC and defined CPUI386}
  33. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  34. {$endc}
  35. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  36. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  37. {$endc}
  38. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  39. {$setc __ppc__ := 1}
  40. {$elsec}
  41. {$setc __ppc__ := 0}
  42. {$endc}
  43. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  44. {$setc __ppc64__ := 1}
  45. {$elsec}
  46. {$setc __ppc64__ := 0}
  47. {$endc}
  48. {$ifc not defined __i386__ and defined CPUI386}
  49. {$setc __i386__ := 1}
  50. {$elsec}
  51. {$setc __i386__ := 0}
  52. {$endc}
  53. {$ifc not defined __x86_64__ and defined CPUX86_64}
  54. {$setc __x86_64__ := 1}
  55. {$elsec}
  56. {$setc __x86_64__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm__ and defined CPUARM}
  59. {$setc __arm__ := 1}
  60. {$elsec}
  61. {$setc __arm__ := 0}
  62. {$endc}
  63. {$ifc not defined __arm64__ and defined CPUAARCH64}
  64. {$setc __arm64__ := 1}
  65. {$elsec}
  66. {$setc __arm64__ := 0}
  67. {$endc}
  68. {$ifc defined cpu64}
  69. {$setc __LP64__ := 1}
  70. {$elsec}
  71. {$setc __LP64__ := 0}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  74. {$error Conflicting definitions for __ppc__ and __i386__}
  75. {$endc}
  76. {$ifc defined __ppc__ and __ppc__}
  77. {$setc TARGET_CPU_PPC := TRUE}
  78. {$setc TARGET_CPU_PPC64 := FALSE}
  79. {$setc TARGET_CPU_X86 := FALSE}
  80. {$setc TARGET_CPU_X86_64 := FALSE}
  81. {$setc TARGET_CPU_ARM := FALSE}
  82. {$setc TARGET_CPU_ARM64 := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __ppc64__ and __ppc64__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := TRUE}
  90. {$setc TARGET_CPU_X86 := FALSE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$setc TARGET_CPU_ARM64 := FALSE}
  94. {$setc TARGET_OS_MAC := TRUE}
  95. {$setc TARGET_OS_IPHONE := FALSE}
  96. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  97. {$setc TARGET_OS_EMBEDDED := FALSE}
  98. {$elifc defined __i386__ and __i386__}
  99. {$setc TARGET_CPU_PPC := FALSE}
  100. {$setc TARGET_CPU_PPC64 := FALSE}
  101. {$setc TARGET_CPU_X86 := TRUE}
  102. {$setc TARGET_CPU_X86_64 := FALSE}
  103. {$setc TARGET_CPU_ARM := FALSE}
  104. {$setc TARGET_CPU_ARM64 := FALSE}
  105. {$ifc defined iphonesim}
  106. {$setc TARGET_OS_MAC := FALSE}
  107. {$setc TARGET_OS_IPHONE := TRUE}
  108. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  109. {$elsec}
  110. {$setc TARGET_OS_MAC := TRUE}
  111. {$setc TARGET_OS_IPHONE := FALSE}
  112. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  113. {$endc}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __x86_64__ and __x86_64__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := TRUE}
  120. {$setc TARGET_CPU_ARM := FALSE}
  121. {$setc TARGET_CPU_ARM64 := FALSE}
  122. {$ifc defined iphonesim}
  123. {$setc TARGET_OS_MAC := FALSE}
  124. {$setc TARGET_OS_IPHONE := TRUE}
  125. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  126. {$elsec}
  127. {$setc TARGET_OS_MAC := TRUE}
  128. {$setc TARGET_OS_IPHONE := FALSE}
  129. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  130. {$endc}
  131. {$setc TARGET_OS_EMBEDDED := FALSE}
  132. {$elifc defined __arm__ and __arm__}
  133. {$setc TARGET_CPU_PPC := FALSE}
  134. {$setc TARGET_CPU_PPC64 := FALSE}
  135. {$setc TARGET_CPU_X86 := FALSE}
  136. {$setc TARGET_CPU_X86_64 := FALSE}
  137. {$setc TARGET_CPU_ARM := TRUE}
  138. {$setc TARGET_CPU_ARM64 := FALSE}
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. {$ifc defined ios}
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$setc TARGET_OS_MAC := TRUE}
  156. {$setc TARGET_OS_IPHONE := FALSE}
  157. {$setc TARGET_OS_EMBEDDED := FALSE}
  158. {$endc}
  159. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  160. {$elsec}
  161. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  162. {$endc}
  163. {$ifc defined __LP64__ and __LP64__ }
  164. {$setc TARGET_CPU_64 := TRUE}
  165. {$elsec}
  166. {$setc TARGET_CPU_64 := FALSE}
  167. {$endc}
  168. {$ifc defined FPC_BIG_ENDIAN}
  169. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  170. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  171. {$elifc defined FPC_LITTLE_ENDIAN}
  172. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  173. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  174. {$elsec}
  175. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  176. {$endc}
  177. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  178. {$setc CALL_NOT_IN_CARBON := FALSE}
  179. {$setc OLDROUTINENAMES := FALSE}
  180. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  181. {$setc OPAQUE_UPP_TYPES := TRUE}
  182. {$setc OTCARBONAPPLICATION := TRUE}
  183. {$setc OTKERNEL := FALSE}
  184. {$setc PM_USE_SESSION_APIS := TRUE}
  185. {$setc TARGET_API_MAC_CARBON := TRUE}
  186. {$setc TARGET_API_MAC_OS8 := FALSE}
  187. {$setc TARGET_API_MAC_OSX := TRUE}
  188. {$setc TARGET_CARBON := TRUE}
  189. {$setc TARGET_CPU_68K := FALSE}
  190. {$setc TARGET_CPU_MIPS := FALSE}
  191. {$setc TARGET_CPU_SPARC := FALSE}
  192. {$setc TARGET_OS_UNIX := FALSE}
  193. {$setc TARGET_OS_WIN32 := FALSE}
  194. {$setc TARGET_RT_MAC_68881 := FALSE}
  195. {$setc TARGET_RT_MAC_CFM := FALSE}
  196. {$setc TARGET_RT_MAC_MACHO := TRUE}
  197. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  198. {$setc TYPE_BOOL := FALSE}
  199. {$setc TYPE_EXTENDED := FALSE}
  200. {$setc TYPE_LONGLONG := TRUE}
  201. uses MacTypes, CFArray, CFBase, CFDictionary, CFHTTPMessage, CFStream;
  202. {$endc} {not MACOSALLINCLUDE}
  203. {$ALIGN POWER}
  204. {
  205. * CFHTTPAuthenticationRef
  206. *
  207. * Discussion:
  208. * This is the type of a reference to HTTP authentication
  209. * information.
  210. }
  211. type
  212. CFHTTPAuthenticationRef = ^_CFHTTPAuthentication; { an opaque type }
  213. _CFHTTPAuthentication = record end;
  214. {
  215. * CFStreamErrorHTTPAuthentication
  216. *
  217. * Discussion:
  218. * Authentication errors which may be returned as a result of trying
  219. * to apply authentication to a request. These errors are in the
  220. * kCFStreamErrorDomainHTTP domain.
  221. }
  222. type
  223. CFStreamErrorHTTPAuthentication = SInt32;
  224. const
  225. {
  226. * The type of authentication to be applied to a request is not
  227. * supported.
  228. }
  229. kCFStreamErrorHTTPAuthenticationTypeUnsupported = -1000;
  230. {
  231. * The username was in a format not suitable for applying to the
  232. * request.
  233. }
  234. kCFStreamErrorHTTPAuthenticationBadUserName = -1001;
  235. {
  236. * The password was in a format not suitable for applying to the
  237. * request.
  238. }
  239. kCFStreamErrorHTTPAuthenticationBadPassword = -1002;
  240. {
  241. * kCFHTTPAuthenticationUsername
  242. *
  243. * Discussion:
  244. * CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
  245. * username for authentication as a CFString. Needs to be added if
  246. * CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
  247. *
  248. * Availability:
  249. * Mac OS X: in version 10.4 and later in CoreServices.framework
  250. * CarbonLib: not available
  251. * Non-Carbon CFM: not available
  252. }
  253. var kCFHTTPAuthenticationUsername: CFStringRef; external name '_kCFHTTPAuthenticationUsername'; (* attribute const *)
  254. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  255. {
  256. * kCFHTTPAuthenticationPassword
  257. *
  258. * Discussion:
  259. * CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
  260. * password for authentication as a CFString. Needs to be added if
  261. * CFHTTPAuthenticationRequiresUserNameAndPassword returns TRUE.
  262. *
  263. * Availability:
  264. * Mac OS X: in version 10.4 and later in CoreServices.framework
  265. * CarbonLib: not available
  266. * Non-Carbon CFM: not available
  267. }
  268. var kCFHTTPAuthenticationPassword: CFStringRef; external name '_kCFHTTPAuthenticationPassword'; (* attribute const *)
  269. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  270. {
  271. * kCFHTTPAuthenticationAccountDomain
  272. *
  273. * Discussion:
  274. * CFDictionary key, for CFHTTPMessageApplyCredentialDictionary. The
  275. * domain for authentication as a CFString. Needs to be added if
  276. * CFHTTPAuthenticationRequiresAccountDomain returns TRUE.
  277. *
  278. * Availability:
  279. * Mac OS X: in version 10.4 and later in CoreServices.framework
  280. * CarbonLib: not available
  281. * Non-Carbon CFM: not available
  282. }
  283. var kCFHTTPAuthenticationAccountDomain: CFStringRef; external name '_kCFHTTPAuthenticationAccountDomain'; (* attribute const *)
  284. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  285. {
  286. * CFHTTPAuthenticationGetTypeID()
  287. *
  288. * Discussion:
  289. * Returns the type identifier of all CFHTTPAuthentication instances.
  290. *
  291. * Mac OS X threading:
  292. * Thread safe
  293. *
  294. * Availability:
  295. * Mac OS X: in version 10.2 and later in CoreServices.framework
  296. * CarbonLib: not available
  297. * Non-Carbon CFM: not available
  298. }
  299. function CFHTTPAuthenticationGetTypeID: CFTypeID; external name '_CFHTTPAuthenticationGetTypeID';
  300. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  301. {
  302. * CFHTTPAuthenticationCreateFromResponse()
  303. *
  304. * Discussion:
  305. * Based on a response of 401 or 407, this function will create a
  306. * new authentication object which can be used for adding
  307. * credentials to future requests.
  308. *
  309. * Mac OS X threading:
  310. * Thread safe
  311. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  312. * multiple threads are not altering the same
  313. * CFHTTPAuthenticationRef at the same time.
  314. *
  315. * Parameters:
  316. *
  317. * alloc:
  318. * Allocator to use for creating authentication object
  319. *
  320. * response:
  321. * Failed response.
  322. *
  323. * Result:
  324. * A freshly created authentication object useful for applying
  325. * authentication credentials to new requests.
  326. *
  327. * Availability:
  328. * Mac OS X: in version 10.2 and later in CoreServices.framework
  329. * CarbonLib: not available
  330. * Non-Carbon CFM: not available
  331. }
  332. function CFHTTPAuthenticationCreateFromResponse( alloc: CFAllocatorRef; response: CFHTTPMessageRef ): CFHTTPAuthenticationRef; external name '_CFHTTPAuthenticationCreateFromResponse';
  333. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  334. {
  335. * CFHTTPAuthenticationIsValid()
  336. *
  337. * Discussion:
  338. * Returns TRUE if the given authentication information was
  339. * instantiated correctly and contains enough information in order
  340. * to be applied to a request. If FALSE is returned, the object may
  341. * still contain information which is useful to the user, e.g.
  342. * unsupported method name. An invalid object may be queried for
  343. * information but may not be applied to a request.
  344. *
  345. * Mac OS X threading:
  346. * Thread safe
  347. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  348. * multiple threads are not altering the same
  349. * CFHTTPAuthenticationRef at the same time.
  350. *
  351. * Parameters:
  352. *
  353. * auth:
  354. * The authentication information being queried.
  355. *
  356. * error:
  357. * Reference to a CFStreamError which will be populated in the
  358. * case of an error in creation. Pass NULL if not interested in
  359. * the failure reason. The error domain will be
  360. * kCFStreamErrorDomainHTTP, and the error code will be one of
  361. * those defined in CFHTTPStream.h or one of those listed as
  362. * CFStreamErrorHTTPAuthentication.
  363. *
  364. * Result:
  365. * TRUE or FALSE depending on whether the authentication object is
  366. * good for applying credentials to further requests.
  367. *
  368. * Availability:
  369. * Mac OS X: in version 10.2 and later in CoreServices.framework
  370. * CarbonLib: not available
  371. * Non-Carbon CFM: not available
  372. }
  373. function CFHTTPAuthenticationIsValid( auth: CFHTTPAuthenticationRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPAuthenticationIsValid';
  374. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  375. {
  376. * CFHTTPAuthenticationAppliesToRequest()
  377. *
  378. * Discussion:
  379. * Returns TRUE if the given request requires credentials based upon
  380. * the given authentication information.
  381. *
  382. * Mac OS X threading:
  383. * Thread safe
  384. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  385. * multiple threads are not altering the same
  386. * CFHTTPAuthenticationRef at the same time.
  387. *
  388. * Parameters:
  389. *
  390. * auth:
  391. * The authentication information being queried.
  392. *
  393. * request:
  394. * The request which is believed to need the given authentication.
  395. *
  396. * Result:
  397. * TRUE if the given authentication information should be applied to
  398. * the request, otherwise FALSE is returned.
  399. *
  400. * Availability:
  401. * Mac OS X: in version 10.2 and later in CoreServices.framework
  402. * CarbonLib: not available
  403. * Non-Carbon CFM: not available
  404. }
  405. function CFHTTPAuthenticationAppliesToRequest( auth: CFHTTPAuthenticationRef; request: CFHTTPMessageRef ): Boolean; external name '_CFHTTPAuthenticationAppliesToRequest';
  406. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  407. {
  408. * CFHTTPAuthenticationRequiresOrderedRequests()
  409. *
  410. * Discussion:
  411. * Some authentication methods require that future requests must be
  412. * performed in an ordered manner, so that information from a
  413. * response can be added to a following request.
  414. *
  415. * Mac OS X threading:
  416. * Thread safe
  417. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  418. * multiple threads are not altering the same
  419. * CFHTTPAuthenticationRef at the same time.
  420. *
  421. * Parameters:
  422. *
  423. * auth:
  424. * The authentication information being queried.
  425. *
  426. * Result:
  427. * Returns TRUE if the given authentication method requires ordered
  428. * requests.
  429. *
  430. * Availability:
  431. * Mac OS X: in version 10.2 and later in CoreServices.framework
  432. * CarbonLib: not available
  433. * Non-Carbon CFM: not available
  434. }
  435. function CFHTTPAuthenticationRequiresOrderedRequests( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresOrderedRequests';
  436. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  437. {
  438. * CFHTTPMessageApplyCredentials()
  439. *
  440. * Discussion:
  441. * Perform the authentication method required on the request using
  442. * the given username and password.
  443. *
  444. * Mac OS X threading:
  445. * Thread safe
  446. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  447. * multiple threads are not altering the same
  448. * CFHTTPAuthenticationRef at the same time.
  449. *
  450. * Parameters:
  451. *
  452. * request:
  453. * The request which is to receive the credentials.
  454. *
  455. * auth:
  456. * The authentication information for the given request.
  457. *
  458. * username:
  459. * The username to use for performing the authentication.
  460. *
  461. * password:
  462. * The password to use for performing the authentication.
  463. *
  464. * error:
  465. * Reference to a CFStreamError which will be populated with the
  466. * error information should one occurr during the application of
  467. * the credentials. Pass NULL if not interested in the failure
  468. * reason. The error domain will be kCFStreamErrorDomainHTTP, and
  469. * the error code will be one of those define in CFHTTPStream.h or
  470. * one of those listed as CFStreamErrorHTTPAuthentication.
  471. *
  472. * Result:
  473. * TRUE will be returned if the application of the credentials to
  474. * the request was successful, otherwise FALSE is returned.
  475. *
  476. * Availability:
  477. * Mac OS X: in version 10.2 and later in CoreServices.framework
  478. * CarbonLib: not available
  479. * Non-Carbon CFM: not available
  480. }
  481. function CFHTTPMessageApplyCredentials( request: CFHTTPMessageRef; auth: CFHTTPAuthenticationRef; username: CFStringRef; password: CFStringRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPMessageApplyCredentials';
  482. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  483. {
  484. * CFHTTPMessageApplyCredentialDictionary()
  485. *
  486. * Discussion:
  487. * Perform the authentication method required on the request using
  488. * the given credential information.
  489. *
  490. * Mac OS X threading:
  491. * Thread safe
  492. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  493. * multiple threads are not altering the same
  494. * CFHTTPAuthenticationRef at the same time.
  495. *
  496. * Parameters:
  497. *
  498. * request:
  499. * The request which is to receive the credentials.
  500. *
  501. * auth:
  502. * The authentication information for the given request.
  503. *
  504. * dict:
  505. * A dictionary containing credentials to be applied to the
  506. * request. Valid keys are declared above.
  507. *
  508. * error:
  509. * Reference to a CFStreamError which will be populated with the
  510. * error information should one occurr during the application of
  511. * the credentials. Pass NULL if not interested in the failure
  512. * reason. The error domain will be kCFStreamErrorDomainHTTP, and
  513. * the error code will be one of those define in CFHTTPStream.h or
  514. * one of those listed as CFStreamErrorHTTPAuthentication.
  515. *
  516. * Result:
  517. * TRUE will be returned if the application of the credentials to
  518. * the request was successful, otherwise FALSE is returned.
  519. *
  520. * Availability:
  521. * Mac OS X: in version 10.4 and later in CoreServices.framework
  522. * CarbonLib: not available
  523. * Non-Carbon CFM: not available
  524. }
  525. function CFHTTPMessageApplyCredentialDictionary( request: CFHTTPMessageRef; auth: CFHTTPAuthenticationRef; dict: CFDictionaryRef; error: CFStreamErrorPtr { can be NULL } ): Boolean; external name '_CFHTTPMessageApplyCredentialDictionary';
  526. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  527. {
  528. * CFHTTPAuthenticationCopyRealm()
  529. *
  530. * Discussion:
  531. * Some authentication techniques provide for namespaces on top of
  532. * domains. This call will return the authentication information's
  533. * namespace if there is one, otherwise it will return NULL. This
  534. * namespace is usually used for prompting the application user for
  535. * a name and password.
  536. *
  537. * Mac OS X threading:
  538. * Thread safe
  539. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  540. * multiple threads are not altering the same
  541. * CFHTTPAuthenticationRef at the same time.
  542. *
  543. * Parameters:
  544. *
  545. * auth:
  546. * The authentication information being queried.
  547. *
  548. * Result:
  549. * This call will return the authentication information's namespace
  550. * if there is one, otherwise it will return NULL.
  551. *
  552. * Availability:
  553. * Mac OS X: in version 10.2 and later in CoreServices.framework
  554. * CarbonLib: not available
  555. * Non-Carbon CFM: not available
  556. }
  557. function CFHTTPAuthenticationCopyRealm( auth: CFHTTPAuthenticationRef ): CFStringRef; external name '_CFHTTPAuthenticationCopyRealm';
  558. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  559. {
  560. * CFHTTPAuthenticationCopyDomains()
  561. *
  562. * Discussion:
  563. * Returns a list of domain URL's on which the given authentication
  564. * should be applied. This function is provided mostly for
  565. * informational purposes. CFHTTPAuthenticationAppliesToRequest
  566. * should be used in order to check whether a request requires the
  567. * authentication.
  568. *
  569. * Mac OS X threading:
  570. * Thread safe
  571. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  572. * multiple threads are not altering the same
  573. * CFHTTPAuthenticationRef at the same time.
  574. *
  575. * Parameters:
  576. *
  577. * auth:
  578. * The authentication information being queried.
  579. *
  580. * Result:
  581. * Returns a list of domain URL's on which the given authentication
  582. * should be applied.
  583. *
  584. * Availability:
  585. * Mac OS X: in version 10.2 and later in CoreServices.framework
  586. * CarbonLib: not available
  587. * Non-Carbon CFM: not available
  588. }
  589. function CFHTTPAuthenticationCopyDomains( auth: CFHTTPAuthenticationRef ): CFArrayRef; external name '_CFHTTPAuthenticationCopyDomains';
  590. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  591. {
  592. * CFHTTPAuthenticationCopyMethod()
  593. *
  594. * Discussion:
  595. * Returns the method of authentication which will be performed when
  596. * applying credentials. The strongest method of authentication
  597. * will be chosen in the case of multiple choices.
  598. *
  599. * Mac OS X threading:
  600. * Thread safe
  601. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  602. * multiple threads are not altering the same
  603. * CFHTTPAuthenticationRef at the same time.
  604. *
  605. * Parameters:
  606. *
  607. * auth:
  608. * The authentication information being queried.
  609. *
  610. * Result:
  611. * Returns the method of authentication which will be performed when
  612. * applying credentials.
  613. *
  614. * Availability:
  615. * Mac OS X: in version 10.2 and later in CoreServices.framework
  616. * CarbonLib: not available
  617. * Non-Carbon CFM: not available
  618. }
  619. function CFHTTPAuthenticationCopyMethod( auth: CFHTTPAuthenticationRef ): CFStringRef; external name '_CFHTTPAuthenticationCopyMethod';
  620. (* __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0) *)
  621. {
  622. * CFHTTPAuthenticationRequiresUserNameAndPassword()
  623. *
  624. * Discussion:
  625. * Returns TRUE if the chosen authentication scheme requires a
  626. * username and password.
  627. *
  628. * Mac OS X threading:
  629. * Thread safe
  630. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  631. * multiple threads are not altering the same
  632. * CFHTTPAuthenticationRef at the same time.
  633. *
  634. * Parameters:
  635. *
  636. * auth:
  637. * The authentication information being queried.
  638. *
  639. * Result:
  640. * Returns TRUE if the chosen authentication scheme requires a
  641. * username and password.
  642. *
  643. * Availability:
  644. * Mac OS X: in version 10.3 and later in CoreServices.framework
  645. * CarbonLib: not available
  646. * Non-Carbon CFM: not available
  647. }
  648. function CFHTTPAuthenticationRequiresUserNameAndPassword( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresUserNameAndPassword';
  649. (* __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0) *)
  650. {
  651. * CFHTTPAuthenticationRequiresAccountDomain()
  652. *
  653. * Discussion:
  654. * Returns TRUE if the chosen authentication scheme requires a
  655. * domain for authentication. Currently, this will return TRUE for
  656. * "NTLM" and FALSE for the other methods.
  657. *
  658. * Mac OS X threading:
  659. * Thread safe
  660. * The API's to CFHTTPAuthenticationRef are thread-safe so long as
  661. * multiple threads are not altering the same
  662. * CFHTTPAuthenticationRef at the same time.
  663. *
  664. * Parameters:
  665. *
  666. * auth:
  667. * The authentication information being queried.
  668. *
  669. * Result:
  670. * Returns TRUE if the chosen authentication scheme requires a
  671. * domain for authentication.
  672. *
  673. * Availability:
  674. * Mac OS X: in version 10.4 and later in CoreServices.framework
  675. * CarbonLib: not available
  676. * Non-Carbon CFM: not available
  677. }
  678. function CFHTTPAuthenticationRequiresAccountDomain( auth: CFHTTPAuthenticationRef ): Boolean; external name '_CFHTTPAuthenticationRequiresAccountDomain';
  679. (* __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0) *)
  680. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  681. end.
  682. {$endc} {not MACOSALLINCLUDE}