AWS.SSOTokenProvider — AWS SDK for JavaScript (original) (raw)

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.

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:

  1. Set the AWS_PROFILE environment variable in your process prior to loading the SDK.
  2. Directly load the AWS.SSOTokenProvider:
var ssoTokenProvider = new AWS.SSOTokenProvider({profile: 'myprofile'});

Constructor Summarycollapse

Property Summarycollapse

Properties inherited from AWS.Token

token, expireTime, expired

Method Summarycollapse

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

Expiry window of five minutes.

Method Details

refresh(callback) ⇒ void

Loads the cached access token from disk.