1 .\" Copyright (c) 2003 - 2007 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Heimdal: krb5_get_init_creds.3 20266 2007-02-18 10:41:10Z lha $
36 .Dt KRB5_GET_INIT_CREDS 3
39 .Nm krb5_get_init_creds ,
40 .Nm krb5_get_init_creds_keytab ,
41 .Nm krb5_get_init_creds_opt ,
42 .Nm krb5_get_init_creds_opt_alloc ,
43 .Nm krb5_get_init_creds_opt_free ,
44 .Nm krb5_get_init_creds_opt_init ,
45 .Nm krb5_get_init_creds_opt_set_address_list ,
46 .Nm krb5_get_init_creds_opt_set_addressless ,
47 .Nm krb5_get_init_creds_opt_set_anonymous ,
48 .Nm krb5_get_init_creds_opt_set_default_flags ,
49 .Nm krb5_get_init_creds_opt_set_etype_list ,
50 .Nm krb5_get_init_creds_opt_set_forwardable ,
51 .Nm krb5_get_init_creds_opt_set_pa_password ,
52 .Nm krb5_get_init_creds_opt_set_paq_request ,
53 .Nm krb5_get_init_creds_opt_set_preauth_list ,
54 .Nm krb5_get_init_creds_opt_set_proxiable ,
55 .Nm krb5_get_init_creds_opt_set_renew_life ,
56 .Nm krb5_get_init_creds_opt_set_salt ,
57 .Nm krb5_get_init_creds_opt_set_tkt_life ,
58 .Nm krb5_get_init_creds_opt_set_canonicalize ,
59 .Nm krb5_get_init_creds_opt_set_win2k ,
60 .Nm krb5_get_init_creds_password ,
62 .Nm krb5_prompter_posix
63 .Nd Kerberos 5 initial authentication functions
65 Kerberos 5 Library (libkrb5, -lkrb5)
69 .Ft krb5_get_init_creds_opt;
72 .Fo krb5_get_init_creds_opt_alloc
73 .Fa "krb5_context context"
74 .Fa "krb5_get_init_creds_opt **opt"
77 .Fo krb5_get_init_creds_opt_free
78 .Fa "krb5_context context"
79 .Fa "krb5_get_init_creds_opt *opt"
82 .Fo krb5_get_init_creds_opt_init
83 .Fa "krb5_get_init_creds_opt *opt"
86 .Fo krb5_get_init_creds_opt_set_address_list
87 .Fa "krb5_get_init_creds_opt *opt"
88 .Fa "krb5_addresses *addresses"
91 .Fo krb5_get_init_creds_opt_set_addressless
92 .Fa "krb5_get_init_creds_opt *opt"
93 .Fa "krb5_boolean addressless"
96 .Fo krb5_get_init_creds_opt_set_anonymous
97 .Fa "krb5_get_init_creds_opt *opt"
101 .Fo krb5_get_init_creds_opt_set_default_flags
102 .Fa "krb5_context context"
103 .Fa "const char *appname"
104 .Fa "krb5_const_realm realm"
105 .Fa "krb5_get_init_creds_opt *opt"
108 .Fo krb5_get_init_creds_opt_set_etype_list
109 .Fa "krb5_get_init_creds_opt *opt"
110 .Fa "krb5_enctype *etype_list"
111 .Fa "int etype_list_length"
114 .Fo krb5_get_init_creds_opt_set_forwardable
115 .Fa "krb5_get_init_creds_opt *opt"
116 .Fa "int forwardable"
119 .Fo krb5_get_init_creds_opt_set_pa_password
120 .Fa "krb5_context context"
121 .Fa "krb5_get_init_creds_opt *opt"
122 .Fa "const char *password"
123 .Fa "krb5_s2k_proc key_proc"
126 .Fo krb5_get_init_creds_opt_set_paq_request
127 .Fa "krb5_context context"
128 .Fa "krb5_get_init_creds_opt *opt"
129 .Fa "krb5_boolean req_pac"
132 .Fo krb5_get_init_creds_opt_set_pkinit
133 .Fa "krb5_context context"
134 .Fa "krb5_get_init_creds_opt *opt"
135 .Fa "const char *cert_file"
136 .Fa "const char *key_file"
137 .Fa "const char *x509_anchors"
142 .Fo krb5_get_init_creds_opt_set_preauth_list
143 .Fa "krb5_get_init_creds_opt *opt"
144 .Fa "krb5_preauthtype *preauth_list"
145 .Fa "int preauth_list_length"
148 .Fo krb5_get_init_creds_opt_set_proxiable
149 .Fa "krb5_get_init_creds_opt *opt"
153 .Fo krb5_get_init_creds_opt_set_renew_life
154 .Fa "krb5_get_init_creds_opt *opt"
155 .Fa "krb5_deltat renew_life"
158 .Fo krb5_get_init_creds_opt_set_salt
159 .Fa "krb5_get_init_creds_opt *opt"
160 .Fa "krb5_data *salt"
163 .Fo krb5_get_init_creds_opt_set_tkt_life
164 .Fa "krb5_get_init_creds_opt *opt"
165 .Fa "krb5_deltat tkt_life"
168 .Fo krb5_get_init_creds_opt_set_canonicalize
169 .Fa "krb5_context context"
170 .Fa "krb5_get_init_creds_opt *opt"
171 .Fa "krb5_boolean req"
174 .Fo krb5_get_init_creds_opt_set_win2k
175 .Fa "krb5_context context"
176 .Fa "krb5_get_init_creds_opt *opt"
177 .Fa "krb5_boolean req"
180 .Fo krb5_get_init_creds
181 .Fa "krb5_context context"
182 .Fa "krb5_creds *creds"
183 .Fa "krb5_principal client"
184 .Fa "krb5_prompter_fct prompter"
185 .Fa "void *prompter_data"
186 .Fa "krb5_deltat start_time"
187 .Fa "const char *in_tkt_service"
188 .Fa "krb5_get_init_creds_opt *options"
191 .Fo krb5_get_init_creds_password
192 .Fa "krb5_context context"
193 .Fa "krb5_creds *creds"
194 .Fa "krb5_principal client"
195 .Fa "const char *password"
196 .Fa "krb5_prompter_fct prompter"
197 .Fa "void *prompter_data"
198 .Fa "krb5_deltat start_time"
199 .Fa "const char *in_tkt_service"
200 .Fa "krb5_get_init_creds_opt *in_options"
203 .Fo krb5_get_init_creds_keytab
204 .Fa "krb5_context context"
205 .Fa "krb5_creds *creds"
206 .Fa "krb5_principal client"
207 .Fa "krb5_keytab keytab"
208 .Fa "krb5_deltat start_time"
209 .Fa "const char *in_tkt_service"
210 .Fa "krb5_get_init_creds_opt *options"
213 .Fo krb5_prompter_posix
214 .Fa "krb5_context context"
216 .Fa "const char *name"
217 .Fa "const char *banner"
218 .Fa "int num_prompts"
219 .Fa "krb5_prompt prompts[]"
222 Getting initial credential ticket for a principal.
223 That may include changing an expired password, and doing preauthentication.
224 This interface that replaces the deprecated
230 If you only want to verify a username and password, consider using
231 .Xr krb5_verify_user 3
232 instead, since it also verifies that initial credentials with using a
233 keytab to make sure the response was from the KDC.
236 .Li krb5_get_init_creds_opt
237 structure is initialized
239 .Fn krb5_get_init_creds_opt_alloc
241 .Fn krb5_get_init_creds_opt_init .
242 .Fn krb5_get_init_creds_opt_alloc
243 allocates a extendible structures that needs to be freed with
244 .Fn krb5_get_init_creds_opt_free .
245 The structure may be modified by any of the
246 .Fn krb5_get_init_creds_opt_set
247 functions to change request parameters and authentication information.
249 If the caller want to use the default options,
251 can be passed instead.
253 The the actual request to the KDC is done by any of the
254 .Fn krb5_get_init_creds ,
255 .Fn krb5_get_init_creds_password ,
257 .Fn krb5_get_init_creds_keytab
259 .Fn krb5_get_init_creds
260 is the least specialized function and can, with the right in data,
261 behave like the latter two.
262 The latter two are there for compatibility with older releases and
263 they are slightly easier to use.
266 is a structure containing the following elements:
272 krb5_prompt_type type
277 is the prompt that should shown to the user
280 is set, the prompter function shouldn't echo the output to the display
283 must be preallocated; it will not be allocated by the prompter
285 Possible values for the
289 .Bl -tag -width Ds -compact -offset indent
290 .It KRB5_PROMPT_TYPE_PASSWORD
291 .It KRB5_PROMPT_TYPE_NEW_PASSWORD
292 .It KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN
293 .It KRB5_PROMPT_TYPE_PREAUTH
294 .It KRB5_PROMPT_TYPE_INFO
297 .Fn krb5_prompter_posix
298 is the default prompter function in a POSIX environment.
300 .Fa krb5_prompter_fct
301 and can be used in the
302 .Fa krb5_get_init_creds
304 .Fn krb5_prompter_posix
310 is zero, then the requested ticket will be valid
311 beginning immediately.
314 indicates how far in the future the ticket should be postdated.
320 that principal name will be
321 used as the server name for the initial ticket request.
322 The realm of the name specified will be ignored and will be set to the
323 realm of the client name.
324 If no in_tkt_service name is specified,
325 krbtgt/CLIENT-REALM@CLIENT-REALM will be used.
327 For the rest of arguments, a configuration or library default will be
328 used if no value is specified in the options structure.
330 .Fn krb5_get_init_creds_opt_set_address_list
333 that is should be stored in the ticket.
335 .Fn krb5_get_init_creds_opt_set_addressless
336 controls if the ticket is requested with addresses or not,
337 .Fn krb5_get_init_creds_opt_set_address_list
338 overrides this option.
340 .Fn krb5_get_init_creds_opt_set_anonymous
341 make the request anonymous if the
343 parameter is non-zero.
345 .Fn krb5_get_init_creds_opt_set_default_flags
346 sets the default flags using the configuration file.
348 .Fn krb5_get_init_creds_opt_set_etype_list
349 set a list of enctypes that the client is willing to support in the
352 .Fn krb5_get_init_creds_opt_set_forwardable
353 request a forwardable ticket.
355 .Fn krb5_get_init_creds_opt_set_pa_password
360 that is going to be used to get a new ticket.
366 if the caller wants to use the default values.
369 is unset and needed, the user will be prompted for it.
371 .Fn krb5_get_init_creds_opt_set_paq_request
372 sets the password that is going to be used to get a new ticket.
374 .Fn krb5_get_init_creds_opt_set_preauth_list
375 sets the list of client-supported preauth types.
377 .Fn krb5_get_init_creds_opt_set_proxiable
378 makes the request proxiable.
380 .Fn krb5_get_init_creds_opt_set_renew_life
381 sets the requested renewable lifetime.
383 .Fn krb5_get_init_creds_opt_set_salt
384 sets the salt that is going to be used in the request.
386 .Fn krb5_get_init_creds_opt_set_tkt_life
387 sets requested ticket lifetime.
389 .Fn krb5_get_init_creds_opt_set_canonicalize
390 requests that the KDC canonicalize the client pricipal if possible.
392 .Fn krb5_get_init_creds_opt_set_win2k
393 turns on compatibility with Windows 2000.
397 .Xr krb5_verify_user 3 ,