SSO Support In AWS SDK For Go Is Now Available

The AWS Single Sign-On (SSO) credential provider enables developers to retrieve temporary AWS credentials linked with an AWS account.

Recently, Amazon announced support for AWS Single Sign-On (SSO) credential providers in the AWS SDK for Go version 1 and version 2. 

The AWS SSO credential provider enables users to retrieve temporary AWS credentials linked with an AWS account and a role that they have been authorized to use with AWS SSO. AWS said that the SDK seamlessly integrates with your AWS SSO named profiles that have been configured and signed-in using the AWS CLI v2.

You will need to configure the AWS SSO named profile using the AWS CLI, in order to get started with AWS SSO in your Go application. You can simply follow the Configuring the AWS CLI to use AWS Single Sign-On user guide to create your profile. 

 

Source: AWS

Then initiate a login with AWS SSO using the AWS CLI and the profile configured in step one. You will get a prompt to open up the provided URL in a web browser and authenticate using your AWS SSO credentials. After successful authentication your session will be cached and can be used by the Go SDK. When you are done with your AWS SSO session you can explicitly log out of all AWS SSO sessions by using aws sso logout or you may wait for the credentials to reach their expiration time.

Users can quickly get started using the AWS SSO credential provider.  The SDK will be able to retrieve temporary AWS credentials that can be used by an application to call AWS services, as long as users have signed-in to AWS SSO using the AWS CLI and those cached credentials have not expired. 

For additional details about using AWS SSO with the Go SDK you can see the Developer Guide.