Skip to content

Commit f9fed01

Browse files
author
awstools
committed
feat(client-sts): IAM now supports outbound identity federation via the STS GetWebIdentityToken API, enabling AWS workloads to securely authenticate with external services using short-lived JSON Web Tokens.
1 parent 622ef03 commit f9fed01

16 files changed

+594
-38
lines changed

clients/client-sts/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,11 @@ GetSessionToken
287287
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sts/command/GetSessionTokenCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sts/Interface/GetSessionTokenCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sts/Interface/GetSessionTokenCommandOutput/)
288288

289289
</details>
290+
<details>
291+
<summary>
292+
GetWebIdentityToken
293+
</summary>
294+
295+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/sts/command/GetWebIdentityTokenCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sts/Interface/GetWebIdentityTokenCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-sts/Interface/GetWebIdentityTokenCommandOutput/)
296+
297+
</details>

clients/client-sts/src/STS.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ import {
4444
GetSessionTokenCommandInput,
4545
GetSessionTokenCommandOutput,
4646
} from "./commands/GetSessionTokenCommand";
47+
import {
48+
GetWebIdentityTokenCommand,
49+
GetWebIdentityTokenCommandInput,
50+
GetWebIdentityTokenCommandOutput,
51+
} from "./commands/GetWebIdentityTokenCommand";
4752
import { STSClient, STSClientConfig } from "./STSClient";
4853

4954
const commands = {
@@ -57,6 +62,7 @@ const commands = {
5762
GetDelegatedAccessTokenCommand,
5863
GetFederationTokenCommand,
5964
GetSessionTokenCommand,
65+
GetWebIdentityTokenCommand,
6066
};
6167

6268
export interface STS {
@@ -216,6 +222,23 @@ export interface STS {
216222
options: __HttpHandlerOptions,
217223
cb: (err: any, data?: GetSessionTokenCommandOutput) => void
218224
): void;
225+
226+
/**
227+
* @see {@link GetWebIdentityTokenCommand}
228+
*/
229+
getWebIdentityToken(
230+
args: GetWebIdentityTokenCommandInput,
231+
options?: __HttpHandlerOptions
232+
): Promise<GetWebIdentityTokenCommandOutput>;
233+
getWebIdentityToken(
234+
args: GetWebIdentityTokenCommandInput,
235+
cb: (err: any, data?: GetWebIdentityTokenCommandOutput) => void
236+
): void;
237+
getWebIdentityToken(
238+
args: GetWebIdentityTokenCommandInput,
239+
options: __HttpHandlerOptions,
240+
cb: (err: any, data?: GetWebIdentityTokenCommandOutput) => void
241+
): void;
219242
}
220243

221244
/**

clients/client-sts/src/STSClient.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ import {
7676
} from "./commands/GetDelegatedAccessTokenCommand";
7777
import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand";
7878
import { GetSessionTokenCommandInput, GetSessionTokenCommandOutput } from "./commands/GetSessionTokenCommand";
79+
import {
80+
GetWebIdentityTokenCommandInput,
81+
GetWebIdentityTokenCommandOutput,
82+
} from "./commands/GetWebIdentityTokenCommand";
7983
import {
8084
ClientInputEndpointParameters,
8185
ClientResolvedEndpointParameters,
@@ -100,7 +104,8 @@ export type ServiceInputTypes =
100104
| GetCallerIdentityCommandInput
101105
| GetDelegatedAccessTokenCommandInput
102106
| GetFederationTokenCommandInput
103-
| GetSessionTokenCommandInput;
107+
| GetSessionTokenCommandInput
108+
| GetWebIdentityTokenCommandInput;
104109

105110
/**
106111
* @public
@@ -115,7 +120,8 @@ export type ServiceOutputTypes =
115120
| GetCallerIdentityCommandOutput
116121
| GetDelegatedAccessTokenCommandOutput
117122
| GetFederationTokenCommandOutput
118-
| GetSessionTokenCommandOutput;
123+
| GetSessionTokenCommandOutput
124+
| GetWebIdentityTokenCommandOutput;
119125

120126
/**
121127
* @public

clients/client-sts/src/commands/AssumeRoleCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ export interface AssumeRoleCommandOutput extends AssumeRoleResponse, __MetadataB
200200
* @throws {@link RegionDisabledException} (client fault)
201201
* <p>STS is not activated in the requested region for the account that is being asked to
202202
* generate credentials. The account administrator must use the IAM console to activate
203-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
204-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
205-
* Guide</i>.</p>
203+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
204+
* User Guide</i>.</p>
206205
*
207206
* @throws {@link STSServiceException}
208207
* <p>Base exception class for all service exceptions from STS service.</p>

clients/client-sts/src/commands/AssumeRoleWithSAMLCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,8 @@ export interface AssumeRoleWithSAMLCommandOutput extends AssumeRoleWithSAMLRespo
242242
* @throws {@link RegionDisabledException} (client fault)
243243
* <p>STS is not activated in the requested region for the account that is being asked to
244244
* generate credentials. The account administrator must use the IAM console to activate
245-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
246-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
247-
* Guide</i>.</p>
245+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
246+
* User Guide</i>.</p>
248247
*
249248
* @throws {@link STSServiceException}
250249
* <p>Base exception class for all service exceptions from STS service.</p>

clients/client-sts/src/commands/AssumeRoleWithWebIdentityCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,8 @@ export interface AssumeRoleWithWebIdentityCommandOutput extends AssumeRoleWithWe
233233
* @throws {@link RegionDisabledException} (client fault)
234234
* <p>STS is not activated in the requested region for the account that is being asked to
235235
* generate credentials. The account administrator must use the IAM console to activate
236-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
237-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
238-
* Guide</i>.</p>
236+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
237+
* User Guide</i>.</p>
239238
*
240239
* @throws {@link STSServiceException}
241240
* <p>Base exception class for all service exceptions from STS service.</p>

clients/client-sts/src/commands/AssumeRootCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ export interface AssumeRootCommandOutput extends AssumeRootResponse, __MetadataB
8888
* @throws {@link RegionDisabledException} (client fault)
8989
* <p>STS is not activated in the requested region for the account that is being asked to
9090
* generate credentials. The account administrator must use the IAM console to activate
91-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
92-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
93-
* Guide</i>.</p>
91+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
92+
* User Guide</i>.</p>
9493
*
9594
* @throws {@link STSServiceException}
9695
* <p>Base exception class for all service exceptions from STS service.</p>

clients/client-sts/src/commands/GetDelegatedAccessTokenCommand.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export interface GetDelegatedAccessTokenCommandInput extends GetDelegatedAccessT
2727
export interface GetDelegatedAccessTokenCommandOutput extends GetDelegatedAccessTokenResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>This API is currently unavailable for general use.</p>
30+
* <p>Exchanges a trade-in token for temporary Amazon Web Services credentials with the permissions
31+
* associated with the assumed principal. This operation allows you to obtain credentials for
32+
* a specific principal based on a trade-in token, enabling delegation of access to Amazon Web Services
33+
* resources.</p>
3134
* @example
3235
* Use a bare-bones client and the command you need to make an API call.
3336
* ```javascript
@@ -61,14 +64,25 @@ export interface GetDelegatedAccessTokenCommandOutput extends GetDelegatedAccess
6164
* @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape.
6265
*
6366
* @throws {@link ExpiredTradeInTokenException} (client fault)
64-
* <p></p>
67+
* <p>The trade-in token provided in the request has expired and can no longer be exchanged
68+
* for credentials. Request a new token and retry the operation.</p>
69+
*
70+
* @throws {@link PackedPolicyTooLargeException} (client fault)
71+
* <p>The request was rejected because the total packed size of the session policies and
72+
* session tags combined was too large. An Amazon Web Services conversion compresses the session policy
73+
* document, session policy ARNs, and session tags into a packed binary format that has a
74+
* separate limit. The error message indicates by percentage how close the policies and
75+
* tags are to the upper size limit. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in
76+
* the <i>IAM User Guide</i>.</p>
77+
* <p>You could receive this error even though you meet other defined session policy and
78+
* session tag limits. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length">IAM and STS Entity Character Limits</a> in the <i>IAM User
79+
* Guide</i>.</p>
6580
*
6681
* @throws {@link RegionDisabledException} (client fault)
6782
* <p>STS is not activated in the requested region for the account that is being asked to
6883
* generate credentials. The account administrator must use the IAM console to activate
69-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
70-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
71-
* Guide</i>.</p>
84+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
85+
* User Guide</i>.</p>
7286
*
7387
* @throws {@link STSServiceException}
7488
* <p>Base exception class for all service exceptions from STS service.</p>

clients/client-sts/src/commands/GetFederationTokenCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,8 @@ export interface GetFederationTokenCommandOutput extends GetFederationTokenRespo
182182
* @throws {@link RegionDisabledException} (client fault)
183183
* <p>STS is not activated in the requested region for the account that is being asked to
184184
* generate credentials. The account administrator must use the IAM console to activate
185-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
186-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
187-
* Guide</i>.</p>
185+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
186+
* User Guide</i>.</p>
188187
*
189188
* @throws {@link STSServiceException}
190189
* <p>Base exception class for all service exceptions from STS service.</p>

clients/client-sts/src/commands/GetSessionTokenCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ export interface GetSessionTokenCommandOutput extends GetSessionTokenResponse, _
121121
* @throws {@link RegionDisabledException} (client fault)
122122
* <p>STS is not activated in the requested region for the account that is being asked to
123123
* generate credentials. The account administrator must use the IAM console to activate
124-
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and
125-
* Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User
126-
* Guide</i>.</p>
124+
* STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM
125+
* User Guide</i>.</p>
127126
*
128127
* @throws {@link STSServiceException}
129128
* <p>Base exception class for all service exceptions from STS service.</p>

0 commit comments

Comments
 (0)