Skip to main content

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, awsuser uses your installed Google Chrome by default. You only need playwright install chromium if 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:

  1. Returns cached credentials if still valid
  2. Otherwise opens a GUI prompt for MFA (password comes from keyring)
  3. Automates Console sign-in in a headless browser
  4. 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

  1. AWS CLI calls awsuser via credential_process
  2. Checks disk cache (~/.awsuser/cache/) — returns immediately if valid
  3. If expired: opens a GUI window for MFA code (password from keyring or GUI)
  4. Automates Console sign-in in a headless browser
  5. Opens CloudShell and runs aws configure export-credentials
  6. 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.

Metadata

Release files for awsuser 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for awsuser 1.0.1
File Interpreter ABI Platform Actions
awsuser-1.0.1-py3-none-any.whl Python 3 none any Details for awsuser-1.0.1-py3-none-any.whl

Release files / awsuser-1.0.1-py3-none-any.whl

Download URL awsuser-1.0.1-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66787903b949968f05feb41cf49f4e96e943ddcbd1716d75026f5da6f544869a
BLAKE2b-256 checksum
How to use checksums
989b5b2a04b1ee6ca46767b7410932b0598d0dc82201df65ecf88374a72f1bbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for awsuser 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page