CLI tool to authenticate AWS IAM users with password + MFA via Console sign-in (no access keys needed)
Project description
awsuser
AWS credential_process tool that authenticates IAM users with password + MFA via Console sign-in. Uses a headless browser to automate login and extract temporary credentials — no pre-existing access keys needed.
Installation
pip install awsuser
playwright install chromium
Note: On macOS and Windows,
awsuseruses your installed Google Chrome by default. You only needplaywright install chromiumif Chrome isn't installed.
Quick Start
# 1. Setup a profile (writes credential_process to ~/.aws/credentials)
awsuser -a 123456789012 -u alice -p myprofile
# 2. Use it — awsuser is called automatically by the AWS CLI
aws s3 ls --profile myprofile
When the AWS CLI needs credentials, it calls awsuser which:
- Returns cached credentials if still valid
- Otherwise opens a GUI prompt for MFA (password comes from keyring)
- Automates Console sign-in in a headless browser
- Extracts credentials from CloudShell and caches them
Usage
# Setup a profile
awsuser -a 123456789012 -u alice -p myprofile
# Save password to keyring (avoids password prompt on future runs)
awsuser -a 123456789012 -u alice --save
# Watch the browser during sign-in (debugging)
awsuser -a 123456789012 -u alice --watch
# Use a specific browser
awsuser -a 123456789012 -u alice --browser firefox
How It Works
- AWS CLI calls
awsuserviacredential_process - Checks disk cache (
~/.awsuser/cache/) — returns immediately if valid - If expired: opens a GUI window for MFA code (password from keyring or GUI)
- Automates Console sign-in in a headless browser
- Opens CloudShell and runs
aws configure export-credentials - Caches and returns credentials as JSON to the AWS CLI
Running Tests
./run_tests.sh
Documentation
License
MIT
Disclaimer
This tool automates the AWS Console sign-in flow using browser automation. It relies on the Console's UI structure which AWS may change without notice. If the tool stops working after an AWS Console update, please open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file awsuser-1.0.0-py3-none-any.whl.
File metadata
- Download URL: awsuser-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb0d0e9d11dc3e263ec4972be2187706fc076a3e8409af8ca64ed5d071c817d9
|
|
| MD5 |
f07eb0ebc853cf1e1218e46fff25bbb2
|
|
| BLAKE2b-256 |
b9193043a385dce92ace48f77a03a1d7f2a4469dfc08d4fadd266854a49d59c4
|