
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Login to AWS SSO with this simple utility - just invoke get_aws_session with: region, role_name, account_id, sso_endpoint. Then use the returned aws session instead of boto3
The AWS SSO Login Utility is a Python package that simplifies the process of logging in to AWS Single Sign-On (SSO) and retrieving an AWS session for programmatic access. With just a single function call, get_aws_session
, you can easily obtain an AWS session to use instead of boto3
.
You can install the package via pip:
pip install sso-aws
To use the utility, follow these steps:
Import the package:
from aws_sso_login import get_aws_session
Invoke the get_aws_session
function with the required parameters:
session = get_aws_session(region='us-west-2', role_name='MyRole', account_id='123456789012', sso_endpoint='https://example.awsapps.com/start')
Make sure to provide the correct values for region
, role_name
, account_id
, and sso_endpoint
.
Now you can use the returned session
object instead of boto3
to interact with AWS services:
# Example: List S3 buckets
s3_client = session.client('s3')
response = s3_client.list_buckets()
print(response['Buckets'])
Here's an example that demonstrates how to use the utility:
from aws_sso_login import get_aws_session
region = 'us-west-2'
role_name = 'MyRole'
account_id = '123456789012'
sso_endpoint = 'https://example.awsapps.com/start'
session = get_aws_session(region=region, role_name=role_name, account_id=account_id, sso_endpoint=sso_endpoint)
# Use the session object for AWS API calls
s3_client = session.client('s3')
response = s3_client.list_buckets()
print(response['Buckets'])
Contributions are welcome! If you find any issues or want to enhance this utility, please submit an issue or a pull request in the GitHub repository.
This project is licensed under the MIT License.
This utility was inspired by the need for a simpler way to log in to AWS SSO and retrieve AWS sessions programmatically. Special thanks to all the contributors and the open-source community.
If you have any questions, suggestions, or feedback, feel free to reach out to the project maintainer at GitHub
Enjoy using the AWS SSO Login Utility! ✨
FAQs
Login to AWS SSO with this simple utility - just invoke get_aws_session with: region, role_name, account_id, sso_endpoint. Then use the returned aws session instead of boto3
We found that sso-aws demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.