1KRB5_GET_CREDS(3)        BSD Library Functions Manual        KRB5_GET_CREDS(3)
2

NAME

4     krb5_get_creds, krb5_get_creds_opt_add_options, krb5_get_creds_opt_alloc,
5     krb5_get_creds_opt_free, krb5_get_creds_opt_set_enctype,
6     krb5_get_creds_opt_set_impersonate, krb5_get_creds_opt_set_options,
7     krb5_get_creds_opt_set_ticket — get credentials from the KDC
8

LIBRARY

10     Kerberos 5 Library (libkrb5, -lkrb5)
11

SYNOPSIS

13     #include <krb5.h>
14
15     krb5_error_code
16     krb5_get_creds(krb5_context context, krb5_get_creds_opt opt,
17         krb5_ccache ccache, krb5_const_principal inprinc,
18         krb5_creds **out_creds);
19
20     void
21     krb5_get_creds_opt_add_options(krb5_context context,
22         krb5_get_creds_opt opt, krb5_flags options);
23
24     krb5_error_code
25     krb5_get_creds_opt_alloc(krb5_context context, krb5_get_creds_opt *opt);
26
27     void
28     krb5_get_creds_opt_free(krb5_context context, krb5_get_creds_opt opt);
29
30     void
31     krb5_get_creds_opt_set_enctype(krb5_context context,
32         krb5_get_creds_opt opt, krb5_enctype enctype);
33
34     krb5_error_code
35     krb5_get_creds_opt_set_impersonate(krb5_context context,
36         krb5_get_creds_opt opt, krb5_const_principal self);
37
38     void
39     krb5_get_creds_opt_set_options(krb5_context context,
40         krb5_get_creds_opt opt, krb5_flags options);
41
42     krb5_error_code
43     krb5_get_creds_opt_set_ticket(krb5_context context,
44         krb5_get_creds_opt opt, const Ticket *ticket);
45

DESCRIPTION

47     krb5_get_creds() fetches credentials specified by opt by first looking in
48     the ccache, and then it doesn't exists, fetch the credential from the KDC
49     using the krbtgts in ccache.  The credential is returned in out_creds and
50     should be freed using the function krb5_free_creds().
51
52     The structure krb5_get_creds_opt controls the behavior of
53     krb5_get_creds().  The structure is opaque to consumers that can set the
54     content of the structure with accessors functions. All accessor functions
55     make copies of the data that is passed into accessor functions, so exter‐
56     nal consumers free the memory before calling krb5_get_creds().
57
58     The structure krb5_get_creds_opt is allocated with
59     krb5_get_creds_opt_alloc() and freed with krb5_get_creds_opt_free().  The
60     free function also frees the content of the structure set by the accessor
61     functions.
62
63     krb5_get_creds_opt_add_options() and krb5_get_creds_opt_set_options()
64     adds and sets options to the krb5_get_creds_opt structure .  The possible
65     options to set are
66     KRB5_GC_CACHED     Only check the ccache, don't got out on network to
67                        fetch credential.
68     KRB5_GC_USER_USER  request a user to user ticket.  This options doesn't
69                        store the resulting user to user credential in the
70                        ccache.
71     KRB5_GC_EXPIRED_OK
72                        returns the credential even if it is expired, default
73                        behavior is trying to refetch the credential from the
74                        KDC.
75     KRB5_GC_NO_STORE   Do not store the resulting credentials in the ccache.
76
77     krb5_get_creds_opt_set_enctype() sets the preferred encryption type of
78     the application. Don't set this unless you have to since if there is no
79     match in the KDC, the function call will fail.
80
81     krb5_get_creds_opt_set_impersonate() sets the principal to impersonate.,
82     Returns a ticket that have the impersonation principal as a client and
83     the requestor as the service. Note that the requested principal have to
84     be the same as the client principal in the krbtgt.
85
86     krb5_get_creds_opt_set_ticket() sets the extra ticket used in user-to-
87     user or contrained delegation use case.
88

SEE ALSO

90     krb5(3), krb5_get_credentials(3), krb5.conf(5)
91
92HEIMDAL                          June 15, 2006                         HEIMDAL
Impressum