aws-msk-iam-sasl-signer-python
Amazon MSK Library in Python for SASL/OAUTHBEARER Auth
What it is and what it does
This package provides a Python library to generate base64-encoded signed authentication tokens for Amazon MSK clusters using IAM credentials. It implements the SASL/OAUTHBEARER mechanism and can source credentials from the AWS default chain, named profiles, assumed roles, or custom credential providers. The library depends on boto3 and botocore for AWS credential handling and Click for CLI support.
You integrate it by creating a token callback that calls one of the token generation methods and passing that callback to your Kafka client's OAUTHBEARER configuration. The library handles IAM signing and token expiry tracking, returning both the token and its expiration time in milliseconds.
Use it for:
- Authenticate Kafka producers and consumers to MSK clusters using IAM roles instead of static credentials.
- Integrate MSK authentication into applications running on EC2 instances with instance profiles or ECS tasks with task roles.
- Use assumed IAM roles to generate temporary tokens for cross-account MSK access.
- Implement token refresh logic in long-running Kafka applications by extracting expiry time from returned values.
- Debug credential chain issues by enabling aws_debug_creds to log which IAM principal is being used.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates IAM-signed SASL/OAUTHBEARER authentication tokens for Amazon MSK clusters using AWS credentials from the default chain, named profiles, assumed roles, or custom providers.
Yes, if you use Amazon MSK and need IAM-based authentication. The package is Production/Stable, supports Python 3.8 through 3.13, has no known vulnerabilities, and is maintained by AWS. Install friction is low. Maintenance is aging (527 days since last release), so verify compatibility with your Kafka client library version before committing.
Install
aws-msk-iam-sasl-signer-python on PyPI
pip
pip install aws-msk-iam-sasl-signer-pythonuv
uv add aws-msk-iam-sasl-signer-pythonpoetry
poetry add aws-msk-iam-sasl-signer-pythonInstalling aws-msk-iam-sasl-signer-python
Before you install
Low install friction; pure Python wheel with three runtime dependencies (Click, boto3, botocore). Last release 527 days ago; repository not archived but maintenance is aging.
License in practice
Apache Software License 2.0 is permissive; you may use, modify, and distribute freely in commercial and private projects with minimal restrictions.
Quickstart
pip install aws-msk-iam-sasl-signer-python
from aws_msk_iam_sasl_signer import MSKAuthTokenProvider
auth_token, expiry_ms = MSKAuthTokenProvider.generate_auth_token('')
Requires AWS credentials configured in your environment (via default chain, named profile, assumed role, or custom credential provider); MSK cluster must support SASL/OAUTHBEARER mechanism.
Verify before relying
- Whether the package works with all Kafka client libraries supporting SASL/OAUTHBEARER or only specific ones.
- Performance characteristics when generating tokens at scale or under high frequency.
- Compatibility with non-standard AWS credential sources beyond those documented.
Package facts
| License | Apache Software License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Click, boto3, botocore |
| Maintenance | aging — 527 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,407,085/month — #2,108 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aws_msk_iam_sasl_signer_python-1.0.2-py2.py3-none-any.whl
Keywords: aws-msk-iam-sasl-signer-python
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
requests-aws-signAdds AWS V4 request signing to the requests…
permissive · top 5,000 on PyPI
aws-cdk.aws-signerProvides AWS CDK constructs for defining…
permissive · top 15,000 on PyPI
aws-requests-authAdds AWS Signature Version 4 authentication to…
permissive · top 1,000 on PyPI
aws-cdk.aws-iamProvides Python constructs for defining AWS IAM…
permissive · top 15,000 on PyPI
awacsawacs generates AWS IAM policy JSON from Python…
permissive · top 15,000 on PyPI
kafkaA pure-Python client library for Apache Kafka…
permissive · top 15,000 on PyPI
mastercard-oauth1-signerGenerates OAuth 1.0a-compliant signatures for…
permissive · top 15,000 on PyPI
mcp-proxy-for-awsBridges MCP clients to AWS-hosted MCP servers…
permissive · top 5,000 on PyPI
aws-assume-role-libSimplifies AWS role assumption in boto3 by…
permissive · top 15,000 on PyPI
boto_session_managerWraps boto3 sessions with typed client…
permissive · top 5,000 on PyPI