You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use.
For more information, see the
Migration Guide and
API Reference.
Class: AWS.SsoCredentials
- Inherits:
-
AWS.Credentials
- Object
- AWS.Credentials
- AWS.SsoCredentials
- Defined in:
- lib/credentials/sso_credentials.js
Overview
Note:
This feature is not supported in the browser environment of the SDK.
Represents credentials from sso.getRoleCredentials API for
sso_*
values defined in shared credentials file.
Using SSO credentials
The credentials file must specify the information below to use sso:
[default]
sso_account_id = 012345678901
sso_region = us-east-1
sso_role_name = SampleRole
sso_start_url = https://d-abc123.awsapps.com/start
This information will be automatically added to your shared credentials file by running
aws configure sso
.
Using custom profiles
The SDK supports loading credentials for separate profiles. This can be done in two ways:
- Set the
AWS_PROFILE
environment variable in your process prior to loading the SDK. - Directly load the AWS.SsoCredentials provider:
var creds = new AWS.SsoCredentials({profile: 'myprofile'});
AWS.config.credentials = creds;
Constructor Summary collapse
-
new AWS.SsoCredentials(options) ⇒ void
constructor
Creates a new SsoCredentials object.
Property Summary
Properties inherited from AWS.Credentials
expired, expireTime, accessKeyId, secretAccessKey, sessionToken, expiryWindow
Method Summary collapse
-
refresh(callback) ⇒ void
Loads the credentials from the AWS SSO process.
Methods inherited from AWS.Credentials
needsRefresh, get, getPromise, refreshPromise
Constructor Details
new AWS.SsoCredentials(options) ⇒ void
Creates a new SsoCredentials object.
Method Details
refresh(callback) ⇒ void
Loads the credentials from the AWS SSO process