Registry / aws / aws-sso-util

aws-sso-util

JSON →
library4.33.0pypypiunverified

aws-sso-util is a Python library and CLI tool that simplifies managing AWS Single Sign-On (SSO) credentials and profiles, abstracting away much of the complexity of the AWS CLI's SSO integration. It provides utilities for logging in, fetching temporary credentials, and configuring profiles. The library is actively maintained with frequent, independent releases for its CLI and programmatic components, with the current version being 4.33.0.

pip install aws-sso-util
INSTALL
IMPORT
SIG · AWS-SSO-UTIL
A
aws-sso-util
awspythonv4.33.0
Install
5.6s avg
Import
Disk
60MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 60.6MB
glibc
py 3.103.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.
fix
Upgrade 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`.
fix
Ensure 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.
fix
Upgrade `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.
fix
Upgrade `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.
fix
Upgrade `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.
fix
Update 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.
fix
Run `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).
Agent activity
25 hits · last 30 days
node
24
OpenAI (training)
1
Resources