9 releases

0.2.2 May 6, 2020
0.2.1 May 6, 2020
0.1.1 May 1, 2020
0.0.4 May 1, 2020
0.0.1 Aug 22, 2019

#922 in Authentication

Download history 1/week @ 2024-03-18 29/week @ 2024-04-01 5/week @ 2024-04-15 5/week @ 2024-04-22 8/week @ 2024-06-03 9/week @ 2024-06-10 15/week @ 2024-06-17 16/week @ 2024-06-24 22/week @ 2024-07-01

62 downloads per month
Used in 2 crates

AGPL-3.0

510KB
11K SLoC

Kerberos client

Concepts

  • KDC (Key Distribution Center): Service that distributes the tickets. The host that provides this server is also called KDC.
  • TGS (Ticket Granting Server): Ticket used to authenticate the user against a specified service.
  • TGT (Ticket Granting Ticket): Ticket used to retrieve the TGS's from the KDC.

Examples

Asking for a TGT:

use kerbeiros::*;
use ascii::AsciiString;
use std::net::*;

// Prepare the arguments
let realm = AsciiString::from_ascii("CONTOSO.COM").unwrap();
let kdc_address = IpAddr::V4(Ipv4Addr::new(192, 168, 0, 1));
let username = AsciiString::from_ascii("Bob").unwrap();
let user_key = Key::Password("S3cr3t".to_string());

// Request the TGT
let tgt_requester = TgtRequester::new(realm, kdc_address);
let credential = tgt_requester.request(&username, Some(&user_key)).unwrap();

// Save the ticket into a Windows format file
credential.clone().save_into_krb_cred_file("bob_tgt.krb").unwrap();

// Save the ticket into a Linux format file
credential.save_into_ccache_file("bob_tgt.ccache").unwrap();

Kerberos References

Dependencies

~9.5MB
~161K SLoC