What is @aws-sdk/credential-provider-sso?
The @aws-sdk/credential-provider-sso package is designed to facilitate the retrieval of AWS credentials using AWS Single Sign-On (SSO). This is particularly useful for developers and applications that need to authenticate against AWS services using SSO. The package simplifies the process of obtaining temporary credentials for AWS SDK clients.
Obtaining AWS credentials from SSO
This feature allows developers to obtain AWS credentials by specifying the SSO start URL, account ID, region, and role name. The credentials can then be used to authenticate AWS SDK clients.
const { fromSSO } = require('@aws-sdk/credential-provider-sso');
const client = new SomeAwsClient({
credentials: fromSSO({
ssoStartUrl: 'https://my-sso-start-url.example.com',
ssoAccountId: '123456789012',
ssoRegion: 'us-west-2',
ssoRoleName: 'MyRoleName'
})
});