| Crates.io | awscloud_sso_cred_helper |
| lib.rs | awscloud_sso_cred_helper |
| version | 1.11.0 |
| created_at | 2025-02-19 12:33:40.928914+00 |
| updated_at | 2025-03-06 19:15:23.576854+00 |
| description | A helper library for AWS SSO credential workflows |
| homepage | https://github.com/davidwebstar34/awscloud_sso_cred_helper |
| repository | https://github.com/davidwebstar34/awscloud_sso_cred_helper |
| max_upload_size | |
| id | 1561279 |
| size | 85,052 |
A crate for managing AWS Single Sign-On (SSO) workflows.
This library provides utilities to interact with AWS SSO using asynchronous operations. It handles client registration, device authorization, token polling, and writing AWS credentials directly to your ~/.aws/credentials file.
Add the following to your Cargo.toml:
Add the following dependency to your Cargo.toml:
[dependencies]
awscloud_sso_cred_helper = "1.11.0"
If you do not supply a start URL or region, the library will prompt you interactively.
use awscloud_sso_cred_helper::AwsSsoWorkflow;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// With no parameters provided, the workflow prompts interactively.
let mut workflow = AwsSsoWorkflow::default();
let credential = workflow.run_workflow().await?;
println!("Account ID: {}", credential.account_id);
println!("Role Name: {}", credential.role_name);
println!("Access Key ID: {}", credential.access_key_id);
println!("Secret Access Key: {}", credential.secret_access_key);
println!("Session Token: {}", credential.session_token);
Ok(())
}
If you do not supply a start URL or region, the library will prompt you interactively.
use awscloud_sso_cred_helper::AwsSsoWorkflow;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut workflow = AwsSsoWorkflow {
start_url: "https://your.awsapps.com/start".to_string(),
region: "eu-west-1".to_string(),
..Default::default()
};
let credential = workflow.run_workflow().await?;
println!("Account ID: {}", credential.account_id);
println!("Role Name: {}", credential.role_name);
println!("Access Key ID: {}", credential.access_key_id);
println!("Secret Access Key: {}", credential.secret_access_key);
println!("Session Token: {}", credential.session_token);
Ok(())
}
clap or similar) as needed.