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.StaticTokenProvider

Inherits:
AWS.Token show all
Defined in:
lib/token/static_token_provider.js

Overview

Represents the simplest token provider. It returns a static token string and has an optional expireTime.

Constructor Summary collapse

Property Summary

Properties inherited from AWS.Token

token, expireTime, expired, expiryWindow

Method Summary

Methods inherited from AWS.Token

needsRefresh, get, getPromise, refreshPromise, refresh

Constructor Details

new AWS.StaticTokenProvider(options) ⇒ void

Creates a new StaticTokenProvider class with a given AWS.StaticTokenProvider.token and optional AWS.StaticTokenProvider.expireTime.

var staticTokenProvider = new AWS.StaticTokenProvider({
  token: 'token'
});
staticTokenProvider.token == 'token' // from constructor

Options Hash (options):

  • token (String)

    represents the literal token string.

  • expireTime (Date)

    optional field representing the time at which the token expires.