GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / man / sasl_client_start.3
1 .\" -*- nroff -*-
2 .\" 
3 .\" Copyright (c) 2001 Carnegie Mellon University.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\"
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer. 
11 .\"
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in
14 .\"    the documentation and/or other materials provided with the
15 .\"    distribution.
16 .\"
17 .\" 3. The name "Carnegie Mellon University" must not be used to
18 .\"    endorse or promote products derived from this software without
19 .\"    prior written permission. For permission or any other legal
20 .\"    details, please contact  
21 .\"      Office of Technology Transfer
22 .\"      Carnegie Mellon University
23 .\"      5000 Forbes Avenue
24 .\"      Pittsburgh, PA  15213-3890
25 .\"      (412) 268-4387, fax: (412) 268-7395
26 .\"      tech-transfer@andrew.cmu.edu
27 .\"
28 .\" 4. Redistributions of any form whatsoever must retain the following
29 .\"    acknowledgment:
30 .\"    "This product includes software developed by Computing Services
31 .\"     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
32 .\"
33 .\" CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
34 .\" THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35 .\" AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
36 .\" FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
37 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
38 .\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
39 .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40 .\" 
41 .TH sasl_client_start "10 July 2001" SASL "SASL man pages"
42 .SH NAME
43 sasl_client_start \- Begin an authentication negotiation
44 .SH SYNOPSIS
45 .nf
46 .B #include <sasl/sasl.h>
47 .sp
48 .BI "int sasl_client_start(sasl_conn_t * " conn ", "
49 .BI "                 const char * " mechlist ", "
50 .BI "                 sasl_interact_t ** " prompt_need ", "
51 .BI "                 const char ** " clientout ", "
52 .BI "                 unsigned * " clientoutlen ", "
53 .BI "                 const char ** " mech ");"
54
55 .fi
56 .SH DESCRIPTION
57
58 .B sasl_client_start()
59 selects a mechanism for authentication and starts the authentication
60 session. The mechlist is the list of mechanisms the client might like
61 to use. The mechanisms in the list are not necessarily supported by
62 the client or even valid. SASL determines which of these to use based
63 upon the security preferences specified earlier. The list of
64 mechanisms is typically a list of mechanisms the server supports
65 acquired from a capability request.
66
67 If SASL_INTERACT is returned the library needs some values to be
68 filled in before it can proceed. The prompt_need structure will be
69 filled in with requests. The application should fulfill these requests
70 and call sasl_client_start again with identical parameters (the
71 prompt_need parameter will be the same pointer as before but filled in
72 by the application).
73
74 .PP
75 .I mechlist
76 is a list of mechanisms the server has available. Punctuation if ignored.
77 .PP
78 .I prompt_need
79 is filled in with a list of prompts needed to continue (if necessary).
80 .PP
81 .I clientout
82 and
83 .I clientoutlen
84 is created. It is the initial client response to send to the
85 server. It is the job of the
86 client to send it over the network to the server.
87 Any protocol specific encoding (such as base64
88 encoding) necessary needs to be done by the client.
89
90 If the protocol lacks client-send-first capability, then set
91 .I clientout
92 to NULL.
93
94 If there is no initial client-send, then
95 .I *clientout
96 will be set to NULL on return.
97
98 .I mech
99 contains the name of the chosen SASL mechanism (on success)
100
101 .SH "RETURN VALUE"
102
103 sasl_client_start returns an integer which corresponds to one of the
104 following codes. SASL_CONTINUE indicates success and that there are
105 more steps needed in the authentication. All other return codes
106 indicate errors and should either be handled or the authentication
107 session should be quit.
108
109 .SH "CONFORMING TO"
110 RFC 2222
111 .SH "SEE ALSO"
112 sasl(3), sasl_callbacks(3), sasl_errors(3), sasl_client_init(3), sasl_client_new(3), sasl_client_step(3)