skillfed

aws-msk-iam-sasl-signer-python

Amazon MSK Library in Python for SASL/OAUTHBEARER Auth

aws-msk-iam-sasl-signer-python v1.0.2 5.4M downloads/30d#2,108 on PyPI45
Permissive license Apache Software License 2.0 AGING released

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-python

uv

uv add aws-msk-iam-sasl-signer-python

poetry

poetry add aws-msk-iam-sasl-signer-python

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

MSK Kafka IAM authenticationAWS MSK SASL OAUTHBEARERKafka IAM token generatorMSK SASL signerAWS Kafka authenticationMSK IAM credentialsOAUTHBEARER token provider
aws-mskkafka-authiam-credentials

More Internet packages