Crates.io | token_adalt |
lib.rs | token_adalt |
version | 0.5.0 |
source | src |
created_at | 2020-11-22 15:44:14.58572 |
updated_at | 2024-01-01 09:10:26.266458 |
description | Rust library that enables you to acquire security token from Azure Active Directory. |
homepage | |
repository | https://github.com/kapilash/token_adalt/ |
max_upload_size | |
id | 315035 |
size | 29,126 |
(Unofficial and temporary) Rust library that enables you to acquire security token from Azure Active Directory.
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?;
Library uses