Class: AWS.TokenFileWebIdentityCredentials
- Inherits:
-
AWS.Credentials
- Object
- AWS.Credentials
- AWS.TokenFileWebIdentityCredentials
- Defined in:
- lib/credentials/token_file_web_identity_credentials.js
Overview
This feature is not supported in the browser environment of the SDK.
Represents OIDC credentials from a file on disk If the credentials expire, the SDK can refresh() the credentials from the file.
Using the web identity token file
This provider is checked by default in the Node.js environment. To use the provider simply add your OIDC token to a file (ASCII encoding) and share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment variable or web_identity_token_file shared config variable
The file contains encoded OIDC token and the characters are ASCII encoded. OIDC tokens are JSON Web Tokens (JWT). JWT's are 3 base64 encoded strings joined by the '.' character.
This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE environment variable or web_identity_token_file shared config variable, and get the OIDC token from filename. It will also read IAM role to be assumed from AWS_ROLE_ARN environment variable or role_arn shared config variable. This provider gets credetials using the AWS.STS.assumeRoleWithWebIdentity() service operation
Constructor Summary collapse
Property Summary
Properties inherited from AWS.Credentials
expired, expireTime, accessKeyId, secretAccessKey, sessionToken, expiryWindow
Method Summary collapse
-
refresh(callback) ⇒ void
Refreshes credentials using AWS.STS.assumeRoleWithWebIdentity().
Methods inherited from AWS.Credentials
needsRefresh, get, getPromise, refreshPromise
Constructor Details
new AWS.TokenFileWebIdentityCredentials(clientConfig) ⇒ void
Method Details
refresh(callback) ⇒ void
Refreshes credentials using AWS.STS.assumeRoleWithWebIdentity()