aws-authenticator
Overview
Login to AWS using CLI named profiles, IAM access key credentials, or SSO.
Prerequisites
Python >= 3.10
aws-ssooidc (https://pypi.org/project/aws-ssooidc/) >= 2021.1.1.1
boto3 (https://pypi.org/project/boto3/) >= 1.17.78
Conditional Arguments
If authenticating with named profiles:
AWSCLI profile name
If authenticating with IAM acccess key credentials:
AWS access key id
AWS secret access key
AWS session token (optional, if using temporary credentials)
If authenticating with SSO:
AWS account ID
AWS SSO Permission Set (role) name
AWS SSO login URL
Additional argument:
AWS region (optional)
Usage
Installation:
pip3 install aws-authenticator
# or
python3 -m pip install aws-authenticator
In Python3 authenticating with default profile:
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator()
session = auth.profile()
client = session.client("<service-name>")
In Python3 authenticating with named profiles:
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
profile_name="<profile-name>"
)
session = auth.profile()
client = session.client("<service-name>")
In Python3 authenticating with IAM access key credentials:
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
access_key_id="<access-key-id>",
secret_access_key="<secret-access-key>",
session_token="<session-token>"
)
session = auth.iam()
client = session.client("<service-name>")
In Python3 authenticating with SSO:
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
sso_url="<sso-url>",
sso_role_name="<sso-role-name>",
sso_account_id="<sso-account-id>",
region_name="<region-name>"
)
session = auth.sso()
client = session.client("<service-name>")
Testing Examples
Testing SSO-based login in Python3:
import aws_authenticator
auth = aws_authenticator.AWSAuthenticator(
sso_url="<sso-url>",
sso_role_name="<sso-role-name>",
sso_account_id="<sso-account-id>",
region_name="<region-name>"
)
session = auth.sso()
client = session.client("sts")
response = client.get_caller_identity()
print(response)
Testing profile-based login as a script in BASH:
aws_callerid
Metadata
Release files for aws_authenticator 2.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aws_authenticator-2.0.8.tar.gz | 3.3 kB | Without provenance | Details for aws_authenticator-2.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aws_authenticator-2.0.8-py3-none-any.whl | Python 3 | none | any | Details for aws_authenticator-2.0.8-py3-none-any.whl |
Total release size: 8.4 kB
Release files / aws_authenticator-2.0.8.tar.gz
| Download URL | aws_authenticator-2.0.8.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed8cec86d5ff0ee6bd6a82a96d1592defb88c0cf7df6209eaf90e4dd2ee16b04
|
|
BLAKE2b-256 checksum How to use checksums |
71a95795756ec003bb0e83bcb6b7bdc9e1eed7e99790e130ef2dd5009077de5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+
|
Release files / aws_authenticator-2.0.8-py3-none-any.whl
| Download URL | aws_authenticator-2.0.8-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
390131da3f8ec3d12cd43bb60d25e8eb9de3455c16544d2c6b4698cb693d0781
|
|
BLAKE2b-256 checksum How to use checksums |
81139e98d7f714cf5d011d9c49f5e61a06f73fded590e6112c54c683fc473074
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+
|
Security for aws_authenticator 2.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.