KRB5_GET_IN_TKT(3)
π KRB5_GET_IN_TKT β ok bestie, sit down, we gotta talk π
so this is the krb5_get_in_tkt(3) page from the Kerberos 5 Library β manual section 3, library functions, and the whole squad here is:
krb5_get_in_tktkrb5_get_in_credkrb5_get_in_tkt_with_passwordkrb5_get_in_tkt_with_keytabkrb5_get_in_tkt_with_skeykrb5_free_kdc_repkrb5_password_key_proc
and what are they, collectively? deprecated initial authentication functions. yeah. that's the vibe. π
π LIBRARY
Kerberos 5 Library (libkrb5, link it with -lkrb5) π«Ά
β¨ SYNOPSIS β¨
#include <krb5.h>
krb5_error_code
krb5_get_in_tkt(krb5_context context, krb5_flags options,
const krb5_addresses *addrs, const krb5_enctype *etypes,
const krb5_preauthtype *ptypes, krb5_key_proc key_proc,
krb5_const_pointer keyseed, krb5_decrypt_proc decrypt_proc,
krb5_const_pointer decryptarg, krb5_creds *creds,
krb5_ccache ccache, krb5_kdc_rep *ret_as_reply);
krb5_error_code
krb5_get_in_cred(krb5_context context, krb5_flags options,
const krb5_addresses *addrs, const krb5_enctype *etypes,
const krb5_preauthtype *ptypes, const krb5_preauthdata *preauth,
krb5_key_proc key_proc, krb5_const_pointer keyseed,
krb5_decrypt_proc decrypt_proc, krb5_const_pointer decryptarg,
krb5_creds *creds, krb5_kdc_rep *ret_as_reply);
krb5_error_code
krb5_get_in_tkt_with_password(krb5_context context, krb5_flags options,
krb5_addresses *addrs, const krb5_enctype *etypes,
const krb5_preauthtype *pre_auth_types, const char *password,
krb5_ccache ccache, krb5_creds *creds, krb5_kdc_rep *ret_as_reply);
krb5_error_code
krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options,
krb5_addresses *addrs, const krb5_enctype *etypes,
const krb5_preauthtype *pre_auth_types, krb5_keytab keytab,
krb5_ccache ccache, krb5_creds *creds, krb5_kdc_rep *ret_as_reply);
krb5_error_code
krb5_get_in_tkt_with_skey(krb5_context context, krb5_flags options,
krb5_addresses *addrs, const krb5_enctype *etypes,
const krb5_preauthtype *pre_auth_types, const krb5_keyblock *key,
krb5_ccache ccache, krb5_creds *creds, krb5_kdc_rep *ret_as_reply);
krb5_error_code
krb5_free_kdc_rep(krb5_context context, krb5_kdc_rep *rep);
krb5_error_code
krb5_password_key_proc(krb5_context context, krb5_enctype type,
krb5_salt salt, krb5_const_pointer keyseed, krb5_keyblock **key);
like. look at those argument lists. they're giving "the 2003 called and it wants its API surface back" π
π¦ DESCRIPTION π¦
ok so first things first, and I need you to hear me on this one:
every single function on this page is deprecated in the MIT implementation, and they're about to be deprecated in Heimdal too. do NOT use them. like, not even a little. it's giving expired milk. π₯π
Now, the actual lore. These functions get you an initial credential ticket for a principal β that's the whole job. And here's the tea: krb5_get_in_cred is the main character. Every other krb5_get_in function uses it under the hood to fetch tickets. The rest are just more specialized, and therefore somewhat easier to use. slay, I guess. π
If literally all you need is to verify a user and a password? Bestie, consider krb5_verify_user(3) instead β it has a much simpler interface. do yourself a favor. π
πΈ the actual functions
krb5_get_in_tkt and krb5_get_in_cred both fetch the initial credential, and both go querying for a key using the key_proc argument. The difference between the two? The way they store things, and it's honestly the whole plot twist:
krb5_get_in_tktstores the credential in akrb5_credskrb5_get_in_credstores the credential in akrb5_ccache
krb5_get_in_tkt_with_password, krb5_get_in_tkt_with_keytab, and krb5_get_in_tkt_with_skey all do the exact same work as krb5_get_in_cred, they're just more specialized. β¨
krb5_get_in_tkt_with_passwordβ uses the client's password to authenticate. If thepasswordargument isNULL, the user gets queried with the default password query function. (yes, the user. queried. π«Ά)krb5_get_in_tkt_with_keytabβ searches the givenkeytabfor a service entry for the client principal. If thekeytabisNULL, the default keytab is used.krb5_get_in_tkt_with_skeyβ uses a key to get the initial credential.
π the common arguments (iykyk)
There are some shared arguments across the krb5_get_in functions, so let's break them down:
optionsβ these are theKDC_OPTflags.etypesβ aNULLterminated array of encryption types that the client approves. πaddrsβ a list of the addresses that the initial ticket... yeah, that's what the page says, don't look at me. If it'sNULL, the list will be generated by the library. π§pre_auth_typesβ aNULLterminated array of pre-authentication types. Ifpre_auth_typesisNULL, the function will try without pre-authentication and return those pre-authentication that the KDC returned.ret_as_replyβ will (if notNULL) be filled in with the response of the KDC, and should be freed withkrb5_free_kdc_rep().key_procβ a pointer to a function that should return a key salted appropriately. UsingNULLwill use the default password query function.decrypt_procβ usingNULLwill use the default decryption function.decryptargβ will be passed to the decryption functiondecrypt_proc.credsβcredsshould be filled in with the template for a credential that should be requested. Theclientandserverelements of thecredsstructure must be filled in. Upon return of the function it will contain the content of the requested credential (krb5_get_in_cred), or it will be freed withkrb5_free_creds(3)(all the otherkrb5_get_infunctions). πccacheβ will store the credential in the credential cacheccache. The credential cache will not be initialized β that's up to the caller. no hand-holding here bestie. π
π the helper besties
krb5_password_key_proc is a library function that's suitable for using as the krb5_key_proc argument to krb5_get_in_cred or krb5_get_in_tkt. keyseed should be a pointer to a NUL terminated string, or NULL. And krb5_password_key_proc will query the user for the pass on the console if the password isn't given as the argument keyseed. iconic behavior honestly. πΈ
krb5_free_kdc_rep() frees the content of rep. that's it. that's the whole function. free it. π¦
π SEE ALSO
krb5(3), krb5_verify_user(3), krb5.conf(5), kerberos(8)
and that's the whole page bestie!! this one's from the HEIMDAL manual, dated May 31, 2003, filed under KRB5_GET_IN_TKT(3) β and no cap, if you actually need to use any of this, please just go read krb5_verify_user(3) instead. periodt. πβ¨π
π¦ where this page comes from
- alpine 3.22: heimdal-doc 7.8.0-r4 Β· BSD-3-Clause
- alpine 3.23: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- alpine 3.24: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- debian bookworm: heimdal-dev 7.8.git20221117.28daf24+dfsg-2 Β· BSD-3-Clause
- debian trixie: heimdal-dev 7.8.git20221117.28daf24+dfsg-9+deb13u1 Β· BSD-3-Clause
- epel 10: heimdal-devel 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-devel 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: heimdal 7.8.0-unstable-2024-09-10
- ubuntu jammy: heimdal-dev 7.7.0+dfsg-3ubuntu1 Β· BSD-3-Clause
- ubuntu noble: heimdal-dev 7.8.git20221117.28daf24+dfsg-5ubuntu3 Β· BSD-3-Clause
- ubuntu questing: heimdal-dev 7.8.git20221117.28daf24+dfsg-9ubuntu1
- ubuntu resolute: heimdal-dev 7.8.git20221117.28daf24+dfsg-11ubuntu1 Β· BSD-3-Clause
- ubuntu stonking: heimdal-dev 7.8.git20240113.1b4565a+dfsg-2ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2003 Kungliga Tekniska HΓΆgskolan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms