Skip to content

(Unofficial) Rust library for acquiring token from Azure Active Directory.

License

Notifications You must be signed in to change notification settings

kapilash/token_adalt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

token_adalt

(Unofficial and temporary) Rust library that enables you to acquire security token from Azure Active Directory.

Supported Credentials

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

  1. reqwest for the calls to Active Directory
  2. openssl for reading certificates
  3. serde for creating jwt
  4. uuid

About

(Unofficial) Rust library for acquiring token from Azure Active Directory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages