The client supports Service-for-User (S4U) extensions for impersonation.
S4U2self
Used by a service to obtain a service ticket to itself on behalf of a user. This allows a service to impersonate a user without knowing their password.
- Parameters:
user_to_impersonate (KerberosTarget), spn_user (optional, can be string or KerberosTarget).
S4U2proxy
Used to extend an existing service ticket (obtained via S4U2self) to a different service. This is the core of constrained delegation.
- Parameters:
s4uself_ticket (the ticket from S4U2self), spn_user (the target service principal).
getST (Combined)
Convenience method that performs both S4U2self and S4U2proxy to return a final service ticket for a target user and service.
from minikerberos.common.target import KerberosTarget
target_user = KerberosTarget(username='user', domain='DOMAIN.COM')
service_spn = KerberosTarget(username='service/host.domain.com', domain='DOMAIN.COM')
# Get a service ticket for the target user at the target service via S4U
st = client.getST(target_user, service_spn)