Install & Compatibility
Where this runs
tested against v4.33.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 60.6MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 5.6s · import 0.000s · 61MB
60MB installed
● package 60MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
get_credentials
✓ from aws_sso_util import get_credentials
✗ from aws_sso_util import get_credentials
This quickstart demonstrates how to programmatically fetch temporary AWS credentials using `get_credentials`. It's crucial to have your AWS SSO profile configured (e.g., via `aws-sso-util configure populate`) and an active SSO session (via `aws-sso-util login`) before running this code.
import os
from aws_sso_util import get_credentials
# Configure your AWS SSO profile name, e.g., 'my-sso-profile'
# Ensure your AWS config file (~/.aws/config) has the sso_start_url, sso_region, and sso_account_id configured
profile_name = os.environ.get('AWS_SSO_PROFILE', 'default')
try:
credentials = get_credentials(profile=profile_name)
print(f"Successfully fetched temporary credentials for profile '{profile_name}':")
print(f" Access Key ID: {credentials['AccessKeyId']}")
print(f" Secret Access Key: {credentials['SecretAccessKey']}")
print(f" Session Token: {credentials['SessionToken'][:8]}...")
print(f" Expiration: {credentials['Expiration']}")
except Exception as e:
print(f"Error fetching credentials: {e}")
print("Please ensure you've run 'aws-sso-util login' and configured your profile.")
aws-sso-util --version
Debug
Known issues
breakingPython 3.6 is no longer supported. Upgrading to Python 3.7+ is required.fixUpgrade your Python environment to 3.7 or newer. This aligns with `boto3`'s Python support.
affects: <4.29 (CLI), <1.12 (lib)
breakingChanges in `botocore` required updates to `get_credentials()` and `aws-sso-credential-process`.fixEnsure you are on the latest `aws-sso-util` version (4.29+ or lib 1.12+) to maintain compatibility with recent `botocore` releases.
affects: <4.29 (CLI), <1.12 (lib)
breakingThe `jsonschema` dependency was updated to a major version (v4). This might cause compatibility issues if other installed packages rely on an older `jsonschema` version.fixUpgrade `aws-sso-util` to 4.33 or newer. If conflicts arise, consider using a virtual environment or upgrading conflicting packages.
affects: <4.33
breakingThe `PyYAML` dependency was updated to v6.0.1. This addresses a Cython issue but could potentially introduce compatibility issues with older `PyYAML` consumers.fixUpgrade `aws-sso-util` to 4.32 or newer. If issues persist, ensure `PyYAML` itself is up-to-date and compatible with other project dependencies.
affects: <4.32
breakingThe `click` dependency was upgraded to version 8. This may impact custom CLI extensions or scripts that rely on specific `click` v7 behaviors.fixUpgrade `aws-sso-util` to 4.31 or newer. Review your CLI scripts for any `click` specific syntax that might have changed.
affects: <4.31
deprecatedThe `--force` option for `aws-sso-util login` and other commands has been deprecated in favor of `--force-refresh` for consistency.fixUpdate your scripts and usage patterns to use `--force-refresh` instead of `--force`.
affects: <4.28
gotchaCached SSO tokens have a limited lifespan (usually 8-12 hours). Operations will fail once the token expires.fixRun `aws-sso-util login --force-refresh` to re-authenticate and refresh your SSO session token when you encounter token expiration errors.
affects: all
Upgrade
Version history
4.33.0latest on PyPI · released Jun 2, 2024
Audit
Dependencies
boto3requiredCore dependency for AWS SDK interactions (implicitly includes botocore).