2 unstable releases
0.5.0 | Jan 1, 2024 |
---|---|
0.1.0 | Nov 22, 2020 |
#414 in Authentication
18KB
286 lines
token_adalt
(Unofficial and temporary) Rust library that enables you to acquire security token from Azure Active Directory.
Supported Credentials
- Client certificate based authentication The library supports both x5c and x5t
- Client secret based authentication
Sample
let tenant_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
let client_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
let cert_location = "abcdefghijklmnopqrstuvw.xyz";
let cert_password = "*********";
let resource = "https://resource.blah.com";
// Create credentials
let creds = adalt::Credentials::Pkcs12 { path: String::from(cert_location), password: String::from(cert_password), x5c:true };
// create the session
let mut ctx = adalt::Context::new(tenant_id, client_id, resource, creds);
// token can be acquired via the future
let token = ctx.get_token().await?;
Dependencies
Library uses
Dependencies
~10–22MB
~327K SLoC