1 .\" Copyright (c) 2006 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
39 .Nm krb5_get_creds_opt_add_options ,
40 .Nm krb5_get_creds_opt_alloc ,
41 .Nm krb5_get_creds_opt_free ,
42 .Nm krb5_get_creds_opt_set_enctype ,
43 .Nm krb5_get_creds_opt_set_impersonate ,
44 .Nm krb5_get_creds_opt_set_options ,
45 .Nm krb5_get_creds_opt_set_ticket
46 .Nd get credentials from the KDC
48 Kerberos 5 Library (libkrb5, -lkrb5)
53 .Fa "krb5_context context"
54 .Fa "krb5_get_creds_opt opt"
55 .Fa "krb5_ccache ccache"
56 .Fa "krb5_const_principal inprinc"
57 .Fa "krb5_creds **out_creds"
60 .Fo krb5_get_creds_opt_add_options
61 .Fa "krb5_context context"
62 .Fa "krb5_get_creds_opt opt"
63 .Fa "krb5_flags options"
66 .Fo krb5_get_creds_opt_alloc
67 .Fa "krb5_context context"
68 .Fa "krb5_get_creds_opt *opt"
71 .Fo krb5_get_creds_opt_free
72 .Fa "krb5_context context"
73 .Fa "krb5_get_creds_opt opt"
76 .Fo krb5_get_creds_opt_set_enctype
77 .Fa "krb5_context context"
78 .Fa "krb5_get_creds_opt opt"
79 .Fa "krb5_enctype enctype"
82 .Fo krb5_get_creds_opt_set_impersonate
83 .Fa "krb5_context context"
84 .Fa "krb5_get_creds_opt opt"
85 .Fa "krb5_const_principal self"
88 .Fo krb5_get_creds_opt_set_options
89 .Fa "krb5_context context"
90 .Fa "krb5_get_creds_opt opt"
91 .Fa "krb5_flags options"
94 .Fo krb5_get_creds_opt_set_ticket
95 .Fa "krb5_context context"
96 .Fa "krb5_get_creds_opt opt"
97 .Fa "const Ticket *ticket"
101 fetches credentials specified by
103 by first looking in the
105 and then it doesn't exists, fetch the credential from the KDC
108 The credential is returned in
110 and should be freed using the function
111 .Fn krb5_free_creds .
114 .Li krb5_get_creds_opt
115 controls the behavior of
117 The structure is opaque to consumers that can set the content of the
118 structure with accessors functions. All accessor functions make copies
119 of the data that is passed into accessor functions, so external
120 consumers free the memory before calling
124 .Li krb5_get_creds_opt
126 .Fn krb5_get_creds_opt_alloc
128 .Fn krb5_get_creds_opt_free .
129 The free function also frees the content of the structure set by the
132 .Fn krb5_get_creds_opt_add_options
134 .Fn krb5_get_creds_opt_set_options
135 adds and sets options to the
136 .Li krb5_get_creds_opt
138 The possible options to set are
139 .Bl -tag -width "KRB5_GC_USER_USER" -compact
143 don't got out on network to fetch credential.
144 .It KRB5_GC_USER_USER
145 request a user to user ticket.
146 This options doesn't store the resulting user to user credential in
149 .It KRB5_GC_EXPIRED_OK
150 returns the credential even if it is expired, default behavior is trying
151 to refetch the credential from the KDC.
153 Do not store the resulting credentials in the
157 .Fn krb5_get_creds_opt_set_enctype
158 sets the preferred encryption type of the application. Don't set this
159 unless you have to since if there is no match in the KDC, the function
162 .Fn krb5_get_creds_opt_set_impersonate
163 sets the principal to impersonate., Returns a ticket that have the
164 impersonation principal as a client and the requestor as the
165 service. Note that the requested principal have to be the same as the
166 client principal in the krbtgt.
168 .Fn krb5_get_creds_opt_set_ticket
169 sets the extra ticket used in user-to-user or contrained delegation use case.
172 .Xr krb5_get_credentials 3 ,