CURLOPT_HTTPAUTH.3 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at http://curl.haxx.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_HTTPAUTH 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_HTTPAUTH \- set HTTP server authentication methods to try
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPAUTH, long bitmask);
  30. .SH DESCRIPTION
  31. Pass a long as parameter, which is set to a bitmask, to tell libcurl which
  32. authentication method(s) you want it to use speaking to the remote server.
  33. The available bits are listed below. If more than one bit is set, libcurl will
  34. first query the site to see which authentication methods it supports and then
  35. pick the best one you allow it to use. For some methods, this will induce an
  36. extra network round-trip. Set the actual name and password with the
  37. \fICURLOPT_USERPWD(3)\fP option or with the \fICURLOPT_USERNAME(3)\fP and the
  38. \fICURLOPT_PASSWORD(3)\fP options.
  39. For authentication with a proxy, see \fICURLOPT_PROXYAUTH(3)\fP.
  40. .IP CURLAUTH_BASIC
  41. HTTP Basic authentication. This is the default choice, and the only method
  42. that is in wide-spread use and supported virtually everywhere. This sends
  43. the user name and password over the network in plain text, easily captured by
  44. others.
  45. .IP CURLAUTH_DIGEST
  46. HTTP Digest authentication. Digest authentication is defined in RFC2617 and
  47. is a more secure way to do authentication over public networks than the
  48. regular old-fashioned Basic method.
  49. .IP CURLAUTH_DIGEST_IE
  50. HTTP Digest authentication with an IE flavor. Digest authentication is
  51. defined in RFC2617 and is a more secure way to do authentication over public
  52. networks than the regular old-fashioned Basic method. The IE flavor is simply
  53. that libcurl will use a special "quirk" that IE is known to have used before
  54. version 7 and that some servers require the client to use.
  55. .IP CURLAUTH_GSSNEGOTIATE
  56. HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
  57. \&"Negotiate") method was designed by Microsoft and is used in their web
  58. applications. It is primarily meant as a support for Kerberos5 authentication
  59. but may also be used along with other authentication methods. For more
  60. information see IETF draft draft-brezak-spnego-http-04.txt.
  61. You need to build libcurl with a suitable GSS-API library for this to work.
  62. .IP CURLAUTH_NTLM
  63. HTTP NTLM authentication. A proprietary protocol invented and used by
  64. Microsoft. It uses a challenge-response and hash concept similar to Digest, to
  65. prevent the password from being eavesdropped.
  66. You need to build libcurl with either OpenSSL, GnuTLS or NSS support for this
  67. option to work, or build libcurl on Windows with SSPI support.
  68. .IP CURLAUTH_NTLM_WB
  69. NTLM delegating to winbind helper. Authentication is performed by a separate
  70. binary application that is executed when needed. The name of the application
  71. is specified at compile time but is typically /usr/bin/ntlm_auth
  72. Note that libcurl will fork when necessary to run the winbind application and
  73. kill it when complete, calling waitpid() to await its exit when done. On POSIX
  74. operating systems, killing the process will cause a SIGCHLD signal to be
  75. raised (regardless of whether \fICURLOPT_NOSIGNAL(3)\fP is set), which must be
  76. handled intelligently by the application. In particular, the application must
  77. not unconditionally call wait() in its SIGCHLD signal handler to avoid being
  78. subject to a race condition. This behavior is subject to change in future
  79. versions of libcurl.
  80. .IP CURLAUTH_ANY
  81. This is a convenience macro that sets all bits and thus makes libcurl pick any
  82. it finds suitable. libcurl will automatically select the one it finds most
  83. secure.
  84. .IP CURLAUTH_ANYSAFE
  85. This is a convenience macro that sets all bits except Basic and thus makes
  86. libcurl pick any it finds suitable. libcurl will automatically select the one
  87. it finds most secure.
  88. .IP CURLAUTH_ONLY
  89. This is a meta symbol. OR this value together with a single specific auth
  90. value to force libcurl to probe for un-restricted auth and if not, only that
  91. single auth algorithm is acceptable.
  92. .SH DEFAULT
  93. CURLAUTH_BASIC
  94. .SH PROTOCOLS
  95. HTTP
  96. .SH EXAMPLE
  97. TODO
  98. .SH AVAILABILITY
  99. Option Added in 7.10.6.
  100. CURLAUTH_DIGEST_IE was added added in 7.19.3
  101. CURLAUTH_ONLY was added in 7.21.3
  102. CURLAUTH_NTLM_WB was added in 7.22.0
  103. .SH RETURN VALUE
  104. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  105. CURLE_NOT_BUILT_IN if the bitmask specified no supported authentication
  106. methods.
  107. .SH "SEE ALSO"
  108. .BR CURLOPT_PROXYAUTH "(3), " CURLOPT_USERPWD "(3), "