AWS SAML AUTHENTICATION CLI

SAML2AWS – Secure AWS Authentication Made Simple

SAML2AWS simplifies AWS authentication with a powerful command-line interface for SAML-based Single Sign-On (SSO). Securely authenticate through your identity provider, retrieve temporary AWS credentials, and manage multiple AWS profiles with ease. Streamline your cloud workflow with fast, reliable, and efficient AWS access.

Secure SAML Login
Temporary Credentials
Multiple AWS Profiles
saml2aws — terminal
# Configure SAML2AWS
$saml2aws configure
# Login to AWS
$saml2aws login
# Verify AWS Credentials
$aws sts get-caller-identity
✓ Authentication Successful
ABOUT SAML2AWS

What Is SAML2AWS?

SAML2AWS is an open-source command-line interface (CLI) tool designed to simplify AWS authentication using SAML 2.0 Single Sign-On (SSO). It enables developers, DevOps engineers, and cloud administrators to securely access AWS resources through supported identity providers and temporary AWS credentials.

Simplify Your AWS Access

SAML2AWS connects your organization's SAML-based identity provider with AWS authentication, making it easier to retrieve temporary security credentials directly from the command line.

Instead of manually managing long-lived access keys, users can authenticate through their existing identity provider and access AWS services using authorized IAM roles.

The tool works with AWS CLI and compatible development tools, helping teams manage authentication across multiple AWS accounts and environments.

SAML 2.0 Single Sign-On authentication
Temporary AWS security credentials
Support for multiple AWS profiles
Integration with AWS CLI workflows

How Does SAML2AWS Work?

Access AWS resources through a simple four-step authentication process.

01

Identity Provider Login

Authenticate through your organization's supported SAML identity provider using the configured login method.

02

SAML Assertion

After successful authentication, the identity provider issues a SAML assertion containing authorized AWS role information.

03

Temporary AWS Credentials

SAML2AWS exchanges the SAML assertion with AWS Security Token Service (STS) to retrieve temporary credentials.

04

Access AWS Resources

Use your temporary credentials with AWS CLI and compatible tools to access resources permitted by your IAM role.

Secure Authentication SAML-based AWS SSO access
Temporary Credentials AWS STS security credentials
Multiple AWS Profiles Organized AWS account access
POWERFUL FEATURES

Key Features of SAML2AWS

SAML2AWS simplifies secure AWS authentication with essential tools for managing SAML-based login, temporary credentials, and multiple AWS environments. Explore the features that make AWS command-line access easier and more efficient.

Secure SAML Authentication

Authenticate through your organization's supported SAML 2.0 identity provider and access authorized AWS resources using federated authentication and IAM roles.

Temporary AWS Credentials

Retrieve temporary AWS security credentials through AWS Security Token Service (STS). Use time-limited sessions instead of relying on permanent IAM access keys for daily tasks.

Multiple AWS Profiles

Organize credentials and authentication settings with named AWS profiles. Manage access across development, testing, and production environments.

Command-Line Integration

Run authentication commands directly from your terminal. Integrate SAML2AWS with AWS CLI and compatible tools to simplify everyday cloud workflows.

Multiple Identity Providers

Connect with supported SAML identity providers, including Okta, ADFS, and PingFederate. Authentication capabilities depend on provider settings.

Multi-Factor Authentication

Work with supported MFA methods provided by your identity provider. Add an extra authentication check while following organizational security policies.

INSTALLATION GUIDE

How to Install SAML2AWS

Install SAML2AWS on Windows, macOS, or Linux. Follow the installation steps for your operating system and verify that the CLI is ready for secure SAML-based AWS authentication.

macOS

Homebrew Installation

Install SAML2AWS using Homebrew and verify the installation directly from your macOS terminal.

01 Install SAML2AWS
$ brew install saml2aws
02 Verify Installation
$ saml2aws --version

Windows

Chocolatey Installation

Install SAML2AWS using Chocolatey and verify the installation from your Windows terminal.

01 Install SAML2AWS
choco install saml2aws
02 Verify Installation
saml2aws --version

Linux

Binary Installation

Install SAML2AWS using a compatible Linux release binary and verify the installation from your terminal.

01 Install SAML2AWS
$ sudo mv saml2aws /usr/local/bin/
02 Verify Installation
$ saml2aws --version

Verify Your SAML2AWS Installation

Run this command to confirm that SAML2AWS is installed and accessible from your terminal.

$ saml2aws --version
CLI COMMAND REFERENCE

Essential SAML2AWS CLI Commands

Explore commonly used SAML2AWS commands for configuring authentication, managing AWS profiles, retrieving temporary credentials, and working with AWS from your terminal.

COMMAND 01

Check Installed Version

Display the installed SAML2AWS version and confirm that the command-line tool is available on your system.

$ saml2aws --version
COMMAND 02

Configure SAML2AWS

Configure your identity provider, username, AWS profile, and authentication settings before starting an AWS login session.

$ saml2aws configure
COMMAND 03

Log In to AWS

Authenticate using your configured SAML identity provider and retrieve temporary AWS credentials for authorized access.

$ saml2aws login
COMMAND 04

Refresh AWS Credentials

Force a new authentication process when your existing temporary credentials have expired or need to be refreshed.

$ saml2aws login --force
COMMAND 05

List Available AWS Roles

Display the AWS roles available through your configured SAML authentication provider and review authorized role options.

$ saml2aws list-roles
COMMAND 06

Open AWS Console

Launch an AWS Management Console session using the credentials and authentication settings associated with your account.

$ saml2aws console
COMMAND 07

Log In with a Profile

Authenticate using a specific named profile to manage AWS account access across different environments.

$ saml2aws login --profile dev
COMMAND 08

View CLI Help

Explore available SAML2AWS commands, supported flags, configuration options, and command-line usage information.

$ saml2aws --help
AWS PROFILE MANAGEMENT

Using SAML2AWS with Multiple AWS Accounts

Manage AWS authentication across development, testing, and production environments using named SAML2AWS profiles. Organize account access and simplify everyday AWS CLI operations.

AWS Profile Management

Organize your AWS environments with named profiles.

Development

Profile: development

DEV

Testing

Profile: testing

TEST

Production

Profile: production

PROD

Manage Multiple AWS Profiles

Use the right profile for your AWS environment.

SAML2AWS allows users to configure named profiles for different AWS accounts and environments. Each profile helps organize authentication settings and temporary AWS credentials.

Once configured, select the required profile during login and use it with AWS CLI commands. Access permissions depend on your organization's IAM role configuration.

Example AWS Profile Commands

Authenticate with a named profile

$ saml2aws login --profile development

Verify your AWS identity

$ aws sts get-caller-identity --profile development

Organized Profiles

Manage multiple AWS environments.

Temporary Credentials

Retrieve time-limited AWS access.

AWS CLI Integration

Work with AWS from your terminal.

SECURITY BEST PRACTICES

SAML2AWS Security Best Practices

SAML2AWS supports secure AWS authentication through SAML-based Single Sign-On and temporary AWS credentials. Following recommended security practices helps protect your authentication workflow, IAM roles, and AWS resources.

Enable Multi-Factor Authentication

Use multi-factor authentication through your supported identity provider whenever available. MFA adds another verification step to the login process and helps protect AWS accounts against unauthorized access. Follow your organization's authentication policies when using SAML2AWS.

01

Use Temporary AWS Credentials

SAML2AWS retrieves temporary credentials through AWS Security Token Service (STS). These credentials expire after a configured session duration, reducing the need for long-lived IAM access keys. Refresh your session when credentials expire and avoid exposing security tokens.

02

Follow Least-Privilege Access

Configure AWS IAM roles with only the permissions required for specific responsibilities. Temporary credentials inherit the permissions associated with the selected role. Review role assignments regularly and avoid granting unnecessary access to sensitive AWS resources.

03

Protect Local Credential Files

Store AWS credential files securely and apply appropriate operating system permissions. Avoid committing credentials to source control or sharing sensitive authentication information through logs and screenshots. Protect cached SAML assertions and remove unnecessary authentication data.

04

Secure AWS access starts with the right configuration. Combine SAML2AWS authentication with strong identity provider policies, carefully managed IAM permissions, and secure credential handling to protect your AWS environment.

TROUBLESHOOTING GUIDE

Common SAML2AWS Problems and Troubleshooting

Troubleshoot common SAML2AWS authentication errors, expired AWS credentials, configuration issues, and IAM permission problems with these practical solutions.

Common Problem Recommended Solution
01

SAML2AWS Login Failed

Login may fail because of an incorrect identity provider URL, authentication settings, or account access restrictions.

Solution: Verify your identity provider URL, username, and authentication method. Use verbose mode to review additional diagnostic information.

$ saml2aws login --verbose
02

Expired AWS Credentials

Temporary AWS credentials expire after the configured session duration and may cause token expiration errors.

Solution: Start a fresh SAML authentication session and retrieve new temporary AWS credentials.

$ saml2aws login --force
03

AWS Profile Not Found

AWS CLI cannot locate the requested profile because its name is missing or does not match the configuration.

Solution: Check the available AWS profiles and confirm that the correct profile name is being used.

$ aws configure list-profiles
04

AWS Access Denied

The selected IAM role may not have permission to perform the requested AWS operation.

Solution: Verify your active AWS identity and review the permissions assigned to your IAM role.

$ aws sts get-caller-identity
05

SAML2AWS Command Not Found

Your terminal cannot locate the SAML2AWS executable because of installation or PATH configuration issues.

Solution: Verify the CLI installation and confirm that its executable directory is included in your system PATH.

$ saml2aws --version
06

Multi-Factor Authentication Failed

MFA errors may occur because of incorrect verification codes, expired challenges, or unsupported methods.

Solution: Confirm the required MFA method, review your identity provider settings, and complete the verification process. Contact your administrator if necessary.

07

Unable to Assume an IAM Role

AWS role assumption can fail because of missing SAML attributes or incorrect IAM trust relationships.

Solution: Review the AWS IAM role assignment, SAML provider settings, and trust policy to confirm the role can be assumed by your account.

08

Configuration Not Working

Incorrect provider settings, authentication URLs, or profile details can prevent SAML2AWS from connecting successfully.

Solution: Review and update your saved SAML2AWS configuration details.

$ saml2aws configure
FREQUENTLY ASKED QUESTIONS

SAML2AWS FAQs

Find answers to frequently asked questions about SAML2AWS, AWS Single Sign-On, identity providers, temporary credentials, CLI configuration, and authentication workflows.

What is SAML2AWS?

SAML2AWS is a command-line tool that helps users authenticate with AWS through a SAML 2.0 identity provider. It retrieves temporary AWS credentials that can be used with AWS CLI tools and other compatible applications.

How does SAML2AWS authentication work?

SAML2AWS authenticates through your configured identity provider and obtains a SAML assertion. It then uses AWS Security Token Service (STS) to request temporary credentials for an authorized IAM role. These credentials can be used to access permitted AWS resources.

Which identity providers does SAML2AWS support?

SAML2AWS supports several SAML-based identity provider integrations, including Okta, ADFS, and OneLogin. Supported authentication methods and integrations depend on the installed SAML2AWS version.

Is SAML2AWS free to use?

Yes. SAML2AWS is an open-source command-line project available under the MIT license. However, AWS services and identity provider subscriptions may have their own costs.

How do I configure SAML2AWS for the first time?

After installing SAML2AWS, run saml2aws configure in your terminal. Enter the required identity provider details, authentication URL, username, and profile settings. Save the configuration before starting your first authentication session.

Can I use SAML2AWS with multiple AWS accounts?

Yes. You can configure named profiles to organize authentication for different AWS environments or accounts. For example, saml2aws login --profile development authenticates using a configured profile named development.

Does SAML2AWS support multi-factor authentication?

SAML2AWS supports MFA workflows for compatible identity providers. Available verification methods depend on your provider, organization's authentication policies, and the installed SAML2AWS version.

How long do SAML2AWS credentials remain valid?

SAML2AWS retrieves temporary AWS credentials that expire after a limited session duration. Their validity depends on the requested duration and applicable AWS IAM role and federation settings.

How do I refresh expired AWS credentials?

Run saml2aws login --force to start a fresh authentication session and request new temporary AWS credentials. Complete any required MFA verification steps.

How can I verify that SAML2AWS login succeeded?

Run aws sts get-caller-identity after authentication. If you're using a named profile, include --profile development with your configured profile name. The output identifies the AWS account and principal associated with your credentials.

How do I install SAML2AWS on Windows, macOS, or Linux?

SAML2AWS can be installed on Windows, macOS, and Linux using supported package managers or a compatible binary release. After installation, run saml2aws --version to verify that the executable is available from your terminal.

Where does SAML2AWS store AWS credentials?

SAML2AWS commonly writes temporary AWS credentials to the AWS shared credentials file, typically ~/.aws/credentials, under the selected profile. Storage behavior can vary based on the configured options. Protect credential files with appropriate file permissions.

Why am I getting an Access Denied error after login?

An Access Denied error usually indicates that the selected IAM role does not have permission to perform the requested AWS action. Verify your account and role using aws sts get-caller-identity, then review the relevant IAM policies with your AWS administrator.

Can SAML2AWS be used with AWS CLI scripts and automation?

Yes. After SAML2AWS retrieves valid temporary credentials, AWS CLI scripts can use the configured profile to perform authorized tasks. For example, you can specify --profile development in AWS CLI commands. Automated workflows must account for credential expiration and any interactive authentication or MFA requirements.

Scroll to Top