krb5_aname_to_localname(3) converts a principal to a system local name


Kerberos 5 Library (libkrb5, -lkrb5)


In krb5.h Ft krb5_boolean Fo krb5_aname_to_localname Fa krb5_context context Fa krb5_const_principal name Fa size_t lnsize Fa char *lname Fc


This function takes a principal Fa name , verifies that it is in the local realm (using Fn krb5_get_default_realms ) and then returns the local name of the principal.

If Fa name isn't in one of the local realms an error is returned.

If the size Fa ( lnsize ) of the local name Fa ( lname ) is too small, an error is returned.

Fn krb5_aname_to_localname should only be use by an application that implements protocols that don't transport the login name and thus needs to convert a principal to a local name.

Protocols should be designed so that they authenticate using Kerberos, send over the login name and then verify the principal that is authenticated is allowed to login and the login name. A way to check if a user is allowed to login is using the function Fn krb5_kuserok .