AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Retrieves and caches an AWS SSO access token to exchange for AWS credentials.

Syntax

Profile (Default)

Invoke-AWSSSOLogin
-Force <SwitchParameter>

Session

Invoke-AWSSSOLogin
-SessionName <String>
-Force <SwitchParameter>

Description

The Invoke-AWSSSOLogin cmdlet retrieves and caches an AWS IAM Identity Center SSO access token to exchange for AWS credentials. To login, the requested profile must have first been set up , typically by using the Initialize-AWSSSOConfiguration Cmdlet. Login will be initiated only when the token or device registration has expired. Please note that only one login session can be active for a given SSO Session, and creating multiple profiles does not allow for multiple users to be authenticated against the same SSO Session.

Parameters

Forces the cmdlet to invalidate the cached token and retrieve a new token.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SessionName <String>
Name of an sso-session section of the configuration file that is used to group configuration variables for acquiring SSO access tokens, which can then be used to acquire AWS credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-ProfileName <String>
The name of an SSO-based profile that contains SSO configuration information. The profile is defined in the shared configuration file '~/.aws/config'. The profile can be set up by using the Initialize-AWSSSOConfiguration cmdlet.
Required?False
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)

Outputs

None
This cmdlet does not generate any output.

Examples

Example 1

Invoke-AWSSSOLogin -ProfileName "sso-test-profile"
Get-S3Bucket -ProfileName "sso-test-profile"
Initiates the SSO login flow for the profile "sso-test-profile". The command will attempt to automatically open the SSO authorization page in the default web browser. Once the authentication process is complete, an AWS SSO access token is retrieved and cached, and can be exchanged for AWS credentials by passing the profile name to service cmdlets.

Supported Version

AWS Tools for PowerShell: 2.x.y.z