We announced the upcoming
end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3.
For dates, additional details, and information on how to migrate, please refer to the linked announcement.
Class: AWS.SSOTokenProvider
- Defined in:
- lib/token/sso_token_provider.js
Overview
Note:
This feature is not supported in the browser environment of the SDK.
Represents token loaded from disk derived from the AWS SSO device grant authorication flow.
Using SSO Token Provider
This provider is checked by default in the Node.js environment in TokenProviderChain. To use the SSO Token Provider, simply add your SSO Start URL and Region to the ~/.aws/config file in the following format:
[default]
sso_start_url = https://d-abc123.awsapps.com/start
sso_region = us-east-1
Using custom profiles
The SDK supports loading token 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.SSOTokenProvider:
var ssoTokenProvider = new AWS.SSOTokenProvider({profile: 'myprofile'});
Constructor Summary collapse
-
new AWS.SSOTokenProvider(options) ⇒ void
constructor
Creates a new token object from cached access token.
Property Summary collapse
-
expiryWindow ⇒ Object
static
readwrite
Expiry window of five minutes.
Properties inherited from AWS.Token
Method Summary collapse
-
refresh(callback) ⇒ void
Loads the cached access token from disk.
Methods inherited from AWS.Token
needsRefresh, get, getPromise, refreshPromise
Constructor Details
new AWS.SSOTokenProvider(options) ⇒ void
Creates a new token object from cached access token.
Property Details
expiryWindow ⇒ Object (static, readwrite)
Expiry window of five minutes.
Method Details
refresh(callback) ⇒ void
Loads the cached access token from disk.