tizen 2.3.1 release
[external/curl.git] / docs / libcurl / opts / CURLOPT_USERPWD.3
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_USERPWD 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_USERPWD \- user name and password to use in authentication
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USERPWD, char *userpwd);
30 .SH DESCRIPTION
31 Pass a char * as parameter, pointing to a zero terminated login details string
32 for the connection. The format of which is: [user name]:[password].
33
34 When using Kerberos V5 authentication with a Windows based server, you should
35 specify the user name part with the domain name in order for the server to
36 successfully obtain a Kerberos Ticket. If you don't then the initial part of
37 the authentication handshake may fail.
38
39 When using NTLM, the user name can be specified simply as the user name
40 without the domain name should the server be part of a single domain and
41 forest.
42
43 To specify the domain name use either Down-Level Logon Name or UPN (User
44 Principal Name) formats. For example, EXAMPLE\\user and user@example.com
45 respectively.
46
47 Some HTTP servers (on Windows) support inclusion of the domain for Basic
48 authentication as well.
49
50 When using HTTP and \fICURLOPT_FOLLOWLOCATION(3)\fP, libcurl might perform
51 several requests to possibly different hosts. libcurl will only send this user
52 and password information to hosts using the initial host name (unless
53 \fICURLOPT_UNRESTRICTED_AUTH(3)\fP is set), so if libcurl follows locations to
54 other hosts it will not send the user and password to those. This is enforced
55 to prevent accidental information leakage.
56
57 Use \fICURLOPT_HTTPAUTH(3)\fP to specify the authentication method for HTTP
58 based connections or \fICURLOPT_LOGIN_OPTIONS(3)\fP to control IMAP, POP3 and
59 SMTP options.
60
61 The user and password strings are not URL decoded, so there's no way to send
62 in a user name containing a colon using this option. Use
63 \fICURLOPT_USERNAME(3)\fP for that, or include it in the URL.
64 .SH DEFAULT
65 NULL
66 .SH PROTOCOLS
67 Most
68 .SH EXAMPLE
69 TODO
70 .SH AVAILABILITY
71 Always
72 .SH RETURN VALUE
73 Returns CURLE_OK on success or
74 CURLE_OUT_OF_MEMORY if there was insufficient heap space.
75 .SH "SEE ALSO"
76 .BR CURLOPT_USERNAME "(3), " CURLOPT_PASSWORD "(3), "