1 .\" $NetBSD: krb5_get_init_creds.3,v 1.1.1.3 2014/04/24 12:45:50 pettai Exp $
3 .\" Copyright (c) 2003 - 2007 Kungliga Tekniska Högskolan
4 .\" (Royal Institute of Technology, Stockholm, Sweden).
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. Neither the name of the Institute nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 .Dt KRB5_GET_INIT_CREDS 3
40 .Nm krb5_get_init_creds ,
41 .Nm krb5_get_init_creds_keytab ,
42 .Nm krb5_get_init_creds_opt ,
43 .Nm krb5_get_init_creds_opt_alloc ,
44 .Nm krb5_get_init_creds_opt_free ,
45 .Nm krb5_get_init_creds_opt_init ,
46 .Nm krb5_get_init_creds_opt_set_address_list ,
47 .Nm krb5_get_init_creds_opt_set_addressless ,
48 .Nm krb5_get_init_creds_opt_set_anonymous ,
49 .Nm krb5_get_init_creds_opt_set_default_flags ,
50 .Nm krb5_get_init_creds_opt_set_etype_list ,
51 .Nm krb5_get_init_creds_opt_set_forwardable ,
52 .Nm krb5_get_init_creds_opt_set_pa_password ,
53 .Nm krb5_get_init_creds_opt_set_paq_request ,
54 .Nm krb5_get_init_creds_opt_set_preauth_list ,
55 .Nm krb5_get_init_creds_opt_set_proxiable ,
56 .Nm krb5_get_init_creds_opt_set_renew_life ,
57 .Nm krb5_get_init_creds_opt_set_salt ,
58 .Nm krb5_get_init_creds_opt_set_tkt_life ,
59 .Nm krb5_get_init_creds_opt_set_canonicalize ,
60 .Nm krb5_get_init_creds_opt_set_win2k ,
61 .Nm krb5_get_init_creds_password ,
63 .Nm krb5_prompter_posix
64 .Nd Kerberos 5 initial authentication functions
66 Kerberos 5 Library (libkrb5, -lkrb5)
70 .Ft krb5_get_init_creds_opt;
73 .Fo krb5_get_init_creds_opt_alloc
74 .Fa "krb5_context context"
75 .Fa "krb5_get_init_creds_opt **opt"
78 .Fo krb5_get_init_creds_opt_free
79 .Fa "krb5_context context"
80 .Fa "krb5_get_init_creds_opt *opt"
83 .Fo krb5_get_init_creds_opt_init
84 .Fa "krb5_get_init_creds_opt *opt"
87 .Fo krb5_get_init_creds_opt_set_address_list
88 .Fa "krb5_get_init_creds_opt *opt"
89 .Fa "krb5_addresses *addresses"
92 .Fo krb5_get_init_creds_opt_set_addressless
93 .Fa "krb5_get_init_creds_opt *opt"
94 .Fa "krb5_boolean addressless"
97 .Fo krb5_get_init_creds_opt_set_anonymous
98 .Fa "krb5_get_init_creds_opt *opt"
102 .Fo krb5_get_init_creds_opt_set_default_flags
103 .Fa "krb5_context context"
104 .Fa "const char *appname"
105 .Fa "krb5_const_realm realm"
106 .Fa "krb5_get_init_creds_opt *opt"
109 .Fo krb5_get_init_creds_opt_set_etype_list
110 .Fa "krb5_get_init_creds_opt *opt"
111 .Fa "krb5_enctype *etype_list"
112 .Fa "int etype_list_length"
115 .Fo krb5_get_init_creds_opt_set_forwardable
116 .Fa "krb5_get_init_creds_opt *opt"
117 .Fa "int forwardable"
120 .Fo krb5_get_init_creds_opt_set_pa_password
121 .Fa "krb5_context context"
122 .Fa "krb5_get_init_creds_opt *opt"
123 .Fa "const char *password"
124 .Fa "krb5_s2k_proc key_proc"
127 .Fo krb5_get_init_creds_opt_set_paq_request
128 .Fa "krb5_context context"
129 .Fa "krb5_get_init_creds_opt *opt"
130 .Fa "krb5_boolean req_pac"
133 .Fo krb5_get_init_creds_opt_set_pkinit
134 .Fa "krb5_context context"
135 .Fa "krb5_get_init_creds_opt *opt"
136 .Fa "const char *cert_file"
137 .Fa "const char *key_file"
138 .Fa "const char *x509_anchors"
143 .Fo krb5_get_init_creds_opt_set_preauth_list
144 .Fa "krb5_get_init_creds_opt *opt"
145 .Fa "krb5_preauthtype *preauth_list"
146 .Fa "int preauth_list_length"
149 .Fo krb5_get_init_creds_opt_set_proxiable
150 .Fa "krb5_get_init_creds_opt *opt"
154 .Fo krb5_get_init_creds_opt_set_renew_life
155 .Fa "krb5_get_init_creds_opt *opt"
156 .Fa "krb5_deltat renew_life"
159 .Fo krb5_get_init_creds_opt_set_salt
160 .Fa "krb5_get_init_creds_opt *opt"
161 .Fa "krb5_data *salt"
164 .Fo krb5_get_init_creds_opt_set_tkt_life
165 .Fa "krb5_get_init_creds_opt *opt"
166 .Fa "krb5_deltat tkt_life"
169 .Fo krb5_get_init_creds_opt_set_canonicalize
170 .Fa "krb5_context context"
171 .Fa "krb5_get_init_creds_opt *opt"
172 .Fa "krb5_boolean req"
175 .Fo krb5_get_init_creds_opt_set_win2k
176 .Fa "krb5_context context"
177 .Fa "krb5_get_init_creds_opt *opt"
178 .Fa "krb5_boolean req"
181 .Fo krb5_get_init_creds
182 .Fa "krb5_context context"
183 .Fa "krb5_creds *creds"
184 .Fa "krb5_principal client"
185 .Fa "krb5_prompter_fct prompter"
186 .Fa "void *prompter_data"
187 .Fa "krb5_deltat start_time"
188 .Fa "const char *in_tkt_service"
189 .Fa "krb5_get_init_creds_opt *options"
192 .Fo krb5_get_init_creds_password
193 .Fa "krb5_context context"
194 .Fa "krb5_creds *creds"
195 .Fa "krb5_principal client"
196 .Fa "const char *password"
197 .Fa "krb5_prompter_fct prompter"
198 .Fa "void *prompter_data"
199 .Fa "krb5_deltat start_time"
200 .Fa "const char *in_tkt_service"
201 .Fa "krb5_get_init_creds_opt *in_options"
204 .Fo krb5_get_init_creds_keytab
205 .Fa "krb5_context context"
206 .Fa "krb5_creds *creds"
207 .Fa "krb5_principal client"
208 .Fa "krb5_keytab keytab"
209 .Fa "krb5_deltat start_time"
210 .Fa "const char *in_tkt_service"
211 .Fa "krb5_get_init_creds_opt *options"
214 .Fo krb5_prompter_posix
215 .Fa "krb5_context context"
217 .Fa "const char *name"
218 .Fa "const char *banner"
219 .Fa "int num_prompts"
220 .Fa "krb5_prompt prompts[]"
223 Getting initial credential ticket for a principal.
224 That may include changing an expired password, and doing preauthentication.
225 This interface that replaces the deprecated
231 If you only want to verify a username and password, consider using
232 .Xr krb5_verify_user 3
233 instead, since it also verifies that initial credentials with using a
234 keytab to make sure the response was from the KDC.
237 .Li krb5_get_init_creds_opt
238 structure is initialized
240 .Fn krb5_get_init_creds_opt_alloc
242 .Fn krb5_get_init_creds_opt_init .
243 .Fn krb5_get_init_creds_opt_alloc
244 allocates a extendible structures that needs to be freed with
245 .Fn krb5_get_init_creds_opt_free .
246 The structure may be modified by any of the
247 .Fn krb5_get_init_creds_opt_set
248 functions to change request parameters and authentication information.
250 If the caller want to use the default options,
252 can be passed instead.
254 The the actual request to the KDC is done by any of the
255 .Fn krb5_get_init_creds ,
256 .Fn krb5_get_init_creds_password ,
258 .Fn krb5_get_init_creds_keytab
260 .Fn krb5_get_init_creds
261 is the least specialized function and can, with the right in data,
262 behave like the latter two.
263 The latter two are there for compatibility with older releases and
264 they are slightly easier to use.
267 is a structure containing the following elements:
273 krb5_prompt_type type
278 is the prompt that should shown to the user
281 is set, the prompter function shouldn't echo the output to the display
284 must be preallocated; it will not be allocated by the prompter
286 Possible values for the
290 .Bl -tag -width Ds -compact -offset indent
291 .It KRB5_PROMPT_TYPE_PASSWORD
292 .It KRB5_PROMPT_TYPE_NEW_PASSWORD
293 .It KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN
294 .It KRB5_PROMPT_TYPE_PREAUTH
295 .It KRB5_PROMPT_TYPE_INFO
298 .Fn krb5_prompter_posix
299 is the default prompter function in a POSIX environment.
301 .Fa krb5_prompter_fct
302 and can be used in the
303 .Fa krb5_get_init_creds
305 .Fn krb5_prompter_posix
311 is zero, then the requested ticket will be valid
312 beginning immediately.
315 indicates how far in the future the ticket should be postdated.
321 that principal name will be
322 used as the server name for the initial ticket request.
323 The realm of the name specified will be ignored and will be set to the
324 realm of the client name.
325 If no in_tkt_service name is specified,
326 krbtgt/CLIENT-REALM@CLIENT-REALM will be used.
328 For the rest of arguments, a configuration or library default will be
329 used if no value is specified in the options structure.
331 .Fn krb5_get_init_creds_opt_set_address_list
334 that is should be stored in the ticket.
336 .Fn krb5_get_init_creds_opt_set_addressless
337 controls if the ticket is requested with addresses or not,
338 .Fn krb5_get_init_creds_opt_set_address_list
339 overrides this option.
341 .Fn krb5_get_init_creds_opt_set_anonymous
342 make the request anonymous if the
344 parameter is non-zero.
346 .Fn krb5_get_init_creds_opt_set_default_flags
347 sets the default flags using the configuration file.
349 .Fn krb5_get_init_creds_opt_set_etype_list
350 set a list of enctypes that the client is willing to support in the
353 .Fn krb5_get_init_creds_opt_set_forwardable
354 request a forwardable ticket.
356 .Fn krb5_get_init_creds_opt_set_pa_password
361 that is going to be used to get a new ticket.
367 if the caller wants to use the default values.
370 is unset and needed, the user will be prompted for it.
372 .Fn krb5_get_init_creds_opt_set_paq_request
373 sets the password that is going to be used to get a new ticket.
375 .Fn krb5_get_init_creds_opt_set_preauth_list
376 sets the list of client-supported preauth types.
378 .Fn krb5_get_init_creds_opt_set_proxiable
379 makes the request proxiable.
381 .Fn krb5_get_init_creds_opt_set_renew_life
382 sets the requested renewable lifetime.
384 .Fn krb5_get_init_creds_opt_set_salt
385 sets the salt that is going to be used in the request.
387 .Fn krb5_get_init_creds_opt_set_tkt_life
388 sets requested ticket lifetime.
390 .Fn krb5_get_init_creds_opt_set_canonicalize
391 requests that the KDC canonicalize the client pricipal if possible.
393 .Fn krb5_get_init_creds_opt_set_win2k
394 turns on compatibility with Windows 2000.
398 .Xr krb5_verify_user 3 ,