aws-sso-lib
Library to make AWS SSO easier
What it is and what it does
aws-sso-lib is a Python library that wraps AWS IAM Identity Center (formerly AWS SSO) to make programmatic authentication and role discovery easier. It provides functions to log users in interactively, obtain boto3 sessions for specific accounts and roles, list available accounts and roles a user has access to, and (for administrators) iterate over all Identity Center assignments—tasks that would otherwise require manual AWS API calls or configuration.
The library depends on boto3 and aws-error-utils, and is designed to work across Python 3.7 through 3.11. It handles credential caching, browser-based login flows with fallback options, and token expiry management, making it practical for scripts that need to assume roles programmatically without hardcoding credentials or requiring manual profile setup.
Use it for:
- Automate AWS role assumption in deployment or CI/CD scripts without storing long-lived credentials.
- Build internal tools that discover and list all available AWS accounts and roles a user can access.
- Write multi-account AWS management scripts where the account and role are baked into the code rather than AWS config files.
- Implement custom authentication flows for AWS applications that need to work with Identity Center without managing separate credential stores.
- Admin scripts that audit or iterate over all Identity Center assignments across accounts and permission sets.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Programmatically interact with AWS IAM Identity Center to obtain boto3 sessions, log in users, and discover available accounts and roles.
Yes, if you need programmatic AWS Identity Center integration. Low install friction, permissive license, and no known vulnerabilities make it safe to adopt. However, the aging maintenance status (last release 2023-01-27) means you should verify compatibility with your boto3 version and current Identity Center API before relying on it for new projects; consider checking the repository for any recent fixes or community forks if you encounter issues.
Install
aws-sso-lib on PyPI
pip
pip install aws-sso-libuv
uv add aws-sso-libpoetry
poetry add aws-sso-libInstalling aws-sso-lib
Before you install
Low install friction with only two runtime dependencies (boto3 and aws-error-utils). Maintenance status is aging—last release was 2023-01-27, over two years ago, though the repository remains active with a recent commit in 2025-08-26 and moderate community engagement (1053 stars).
License in practice
Licensed under Apache-2.0 (permissive), which allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install aws-sso-lib
import aws_sso_lib
# Log in to Identity Center
aws_sso_lib.login('https://my-start-url.awsapps.com/start', 'us-east-2')
# Get a boto3 session for a specific account and role
session = aws_sso_lib.get_boto3_session(
start_url='https://my-start-url.awsapps.com/start',
sso_region='us-east-2',
account_id='ACCOUNT_ID',
role_name='ROLE_NAME',
region='us-east-1'
)
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode given the 2+ year gap since last release
- Compatibility with recent AWS Identity Center API changes or breaking changes in boto3
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.7,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — boto3, aws-error-utils |
| Maintenance | aging — 1,295 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 151,957/month — #10,916 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aws_sso_lib-1.14.0-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
aws-sso-utilaws-sso-util provides command-line utilities…
permissive · top 15,000 on PyPI
yawssoSyncs AWS CLI v2 SSO login sessions into legacy…
permissive · top 15,000 on PyPI
aws-assume-role-libSimplifies AWS role assumption in boto3 by…
permissive · top 15,000 on PyPI
boto3-assumeWraps boto3 to create AWS IAM assume-role…
permissive · top 15,000 on PyPI
gimme-aws-credsA CLI tool that obtains temporary AWS…
permissive · top 15,000 on PyPI
boto_session_managerWraps boto3 sessions with typed client…
permissive · top 5,000 on PyPI
google-cloud-iamProvides a Python client library for Google…
permissive · top 5,000 on PyPI
oneloginOfficial Python SDK for OneLogin's API,…
unclear · top 15,000 on PyPI
aws-cdk.aws-iamProvides Python constructs for defining AWS IAM…
permissive · top 15,000 on PyPI
requests-aws-signAdds AWS V4 request signing to the requests…
permissive · top 5,000 on PyPI