@aws-sdk/client-sso-oidc 3.451.0 → 3.454.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +20 -13
  2. package/dist-cjs/SSOOIDC.js +2 -0
  3. package/dist-cjs/SSOOIDCClient.js +6 -4
  4. package/dist-cjs/commands/CreateTokenCommand.js +3 -2
  5. package/dist-cjs/commands/CreateTokenWithIAMCommand.js +54 -0
  6. package/dist-cjs/commands/RegisterClientCommand.js +2 -1
  7. package/dist-cjs/commands/StartDeviceAuthorizationCommand.js +2 -1
  8. package/dist-cjs/commands/index.js +1 -0
  9. package/dist-cjs/endpoint/EndpointParameters.js +1 -1
  10. package/dist-cjs/models/models_0.js +56 -1
  11. package/dist-cjs/protocols/Aws_restJson1.js +124 -1
  12. package/dist-cjs/runtimeConfig.browser.js +1 -0
  13. package/dist-cjs/runtimeConfig.js +3 -0
  14. package/dist-es/SSOOIDC.js +2 -0
  15. package/dist-es/SSOOIDCClient.js +6 -4
  16. package/dist-es/commands/CreateTokenCommand.js +3 -2
  17. package/dist-es/commands/CreateTokenWithIAMCommand.js +50 -0
  18. package/dist-es/commands/RegisterClientCommand.js +2 -1
  19. package/dist-es/commands/StartDeviceAuthorizationCommand.js +2 -1
  20. package/dist-es/commands/index.js +1 -0
  21. package/dist-es/endpoint/EndpointParameters.js +1 -1
  22. package/dist-es/models/models_0.js +48 -0
  23. package/dist-es/protocols/Aws_restJson1.js +122 -1
  24. package/dist-es/runtimeConfig.browser.js +1 -0
  25. package/dist-es/runtimeConfig.js +3 -0
  26. package/dist-types/SSOOIDC.d.ts +19 -13
  27. package/dist-types/SSOOIDCClient.d.ts +24 -17
  28. package/dist-types/commands/CreateTokenCommand.d.ts +3 -3
  29. package/dist-types/commands/CreateTokenWithIAMCommand.d.ts +140 -0
  30. package/dist-types/commands/index.d.ts +1 -0
  31. package/dist-types/index.d.ts +12 -13
  32. package/dist-types/models/models_0.d.ts +364 -36
  33. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  34. package/dist-types/runtimeConfig.browser.d.ts +7 -0
  35. package/dist-types/runtimeConfig.d.ts +7 -0
  36. package/dist-types/runtimeConfig.native.d.ts +7 -0
  37. package/dist-types/ts3.4/SSOOIDC.d.ts +17 -0
  38. package/dist-types/ts3.4/SSOOIDCClient.d.ts +14 -0
  39. package/dist-types/ts3.4/commands/CreateTokenWithIAMCommand.d.ts +39 -0
  40. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  41. package/dist-types/ts3.4/models/models_0.d.ts +50 -0
  42. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
  43. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +24 -0
  44. package/dist-types/ts3.4/runtimeConfig.d.ts +24 -0
  45. package/dist-types/ts3.4/runtimeConfig.native.d.ts +24 -0
  46. package/package.json +4 -1
@@ -3,6 +3,6 @@ export const resolveClientEndpointParameters = (options) => {
3
3
  ...options,
4
4
  useDualstackEndpoint: options.useDualstackEndpoint ?? false,
5
5
  useFipsEndpoint: options.useFipsEndpoint ?? false,
6
- defaultSigningName: "awsssooidc",
6
+ defaultSigningName: "sso-oauth",
7
7
  };
8
8
  };
@@ -1,3 +1,4 @@
1
+ import { SENSITIVE_STRING } from "@smithy/smithy-client";
1
2
  import { SSOOIDCServiceException as __BaseException } from "./SSOOIDCServiceException";
2
3
  export class AccessDeniedException extends __BaseException {
3
4
  constructor(opts) {
@@ -153,6 +154,22 @@ export class UnsupportedGrantTypeException extends __BaseException {
153
154
  this.error_description = opts.error_description;
154
155
  }
155
156
  }
157
+ export class InvalidRequestRegionException extends __BaseException {
158
+ constructor(opts) {
159
+ super({
160
+ name: "InvalidRequestRegionException",
161
+ $fault: "client",
162
+ ...opts,
163
+ });
164
+ this.name = "InvalidRequestRegionException";
165
+ this.$fault = "client";
166
+ Object.setPrototypeOf(this, InvalidRequestRegionException.prototype);
167
+ this.error = opts.error;
168
+ this.error_description = opts.error_description;
169
+ this.endpoint = opts.endpoint;
170
+ this.region = opts.region;
171
+ }
172
+ }
156
173
  export class InvalidClientMetadataException extends __BaseException {
157
174
  constructor(opts) {
158
175
  super({
@@ -167,3 +184,34 @@ export class InvalidClientMetadataException extends __BaseException {
167
184
  this.error_description = opts.error_description;
168
185
  }
169
186
  }
187
+ export const CreateTokenRequestFilterSensitiveLog = (obj) => ({
188
+ ...obj,
189
+ ...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
190
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
191
+ });
192
+ export const CreateTokenResponseFilterSensitiveLog = (obj) => ({
193
+ ...obj,
194
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
195
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
196
+ ...(obj.idToken && { idToken: SENSITIVE_STRING }),
197
+ });
198
+ export const CreateTokenWithIAMRequestFilterSensitiveLog = (obj) => ({
199
+ ...obj,
200
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
201
+ ...(obj.assertion && { assertion: SENSITIVE_STRING }),
202
+ ...(obj.subjectToken && { subjectToken: SENSITIVE_STRING }),
203
+ });
204
+ export const CreateTokenWithIAMResponseFilterSensitiveLog = (obj) => ({
205
+ ...obj,
206
+ ...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
207
+ ...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
208
+ ...(obj.idToken && { idToken: SENSITIVE_STRING }),
209
+ });
210
+ export const RegisterClientResponseFilterSensitiveLog = (obj) => ({
211
+ ...obj,
212
+ ...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
213
+ });
214
+ export const StartDeviceAuthorizationRequestFilterSensitiveLog = (obj) => ({
215
+ ...obj,
216
+ ...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
217
+ });
@@ -1,6 +1,6 @@
1
1
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
2
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
3
- import { AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidClientMetadataException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, } from "../models/models_0";
3
+ import { AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidClientMetadataException, InvalidGrantException, InvalidRequestException, InvalidRequestRegionException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, } from "../models/models_0";
4
4
  import { SSOOIDCServiceException as __BaseException } from "../models/SSOOIDCServiceException";
5
5
  export const se_CreateTokenCommand = async (input, context) => {
6
6
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -29,6 +29,39 @@ export const se_CreateTokenCommand = async (input, context) => {
29
29
  body,
30
30
  });
31
31
  };
32
+ export const se_CreateTokenWithIAMCommand = async (input, context) => {
33
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
34
+ const headers = {
35
+ "content-type": "application/json",
36
+ };
37
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/token";
38
+ const query = map({
39
+ aws_iam: [, "t"],
40
+ });
41
+ let body;
42
+ body = JSON.stringify(take(input, {
43
+ assertion: [],
44
+ clientId: [],
45
+ code: [],
46
+ grantType: [],
47
+ redirectUri: [],
48
+ refreshToken: [],
49
+ requestedTokenType: [],
50
+ scope: (_) => _json(_),
51
+ subjectToken: [],
52
+ subjectTokenType: [],
53
+ }));
54
+ return new __HttpRequest({
55
+ protocol,
56
+ hostname,
57
+ port,
58
+ method: "POST",
59
+ headers,
60
+ path: resolvedPath,
61
+ query,
62
+ body,
63
+ });
64
+ };
32
65
  export const se_RegisterClientCommand = async (input, context) => {
33
66
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
34
67
  const headers = {
@@ -140,6 +173,78 @@ const de_CreateTokenCommandError = async (output, context) => {
140
173
  });
141
174
  }
142
175
  };
176
+ export const de_CreateTokenWithIAMCommand = async (output, context) => {
177
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
178
+ return de_CreateTokenWithIAMCommandError(output, context);
179
+ }
180
+ const contents = map({
181
+ $metadata: deserializeMetadata(output),
182
+ });
183
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
184
+ const doc = take(data, {
185
+ accessToken: __expectString,
186
+ expiresIn: __expectInt32,
187
+ idToken: __expectString,
188
+ issuedTokenType: __expectString,
189
+ refreshToken: __expectString,
190
+ scope: _json,
191
+ tokenType: __expectString,
192
+ });
193
+ Object.assign(contents, doc);
194
+ return contents;
195
+ };
196
+ const de_CreateTokenWithIAMCommandError = async (output, context) => {
197
+ const parsedOutput = {
198
+ ...output,
199
+ body: await parseErrorBody(output.body, context),
200
+ };
201
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
202
+ switch (errorCode) {
203
+ case "AccessDeniedException":
204
+ case "com.amazonaws.ssooidc#AccessDeniedException":
205
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
206
+ case "AuthorizationPendingException":
207
+ case "com.amazonaws.ssooidc#AuthorizationPendingException":
208
+ throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
209
+ case "ExpiredTokenException":
210
+ case "com.amazonaws.ssooidc#ExpiredTokenException":
211
+ throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
212
+ case "InternalServerException":
213
+ case "com.amazonaws.ssooidc#InternalServerException":
214
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
215
+ case "InvalidClientException":
216
+ case "com.amazonaws.ssooidc#InvalidClientException":
217
+ throw await de_InvalidClientExceptionRes(parsedOutput, context);
218
+ case "InvalidGrantException":
219
+ case "com.amazonaws.ssooidc#InvalidGrantException":
220
+ throw await de_InvalidGrantExceptionRes(parsedOutput, context);
221
+ case "InvalidRequestException":
222
+ case "com.amazonaws.ssooidc#InvalidRequestException":
223
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context);
224
+ case "InvalidRequestRegionException":
225
+ case "com.amazonaws.ssooidc#InvalidRequestRegionException":
226
+ throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context);
227
+ case "InvalidScopeException":
228
+ case "com.amazonaws.ssooidc#InvalidScopeException":
229
+ throw await de_InvalidScopeExceptionRes(parsedOutput, context);
230
+ case "SlowDownException":
231
+ case "com.amazonaws.ssooidc#SlowDownException":
232
+ throw await de_SlowDownExceptionRes(parsedOutput, context);
233
+ case "UnauthorizedClientException":
234
+ case "com.amazonaws.ssooidc#UnauthorizedClientException":
235
+ throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
236
+ case "UnsupportedGrantTypeException":
237
+ case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
238
+ throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
239
+ default:
240
+ const parsedBody = parsedOutput.body;
241
+ return throwDefaultError({
242
+ output,
243
+ parsedBody,
244
+ errorCode,
245
+ });
246
+ }
247
+ };
143
248
  export const de_RegisterClientCommand = async (output, context) => {
144
249
  if (output.statusCode !== 200 && output.statusCode >= 300) {
145
250
  return de_RegisterClientCommandError(output, context);
@@ -350,6 +455,22 @@ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
350
455
  });
351
456
  return __decorateServiceException(exception, parsedOutput.body);
352
457
  };
458
+ const de_InvalidRequestRegionExceptionRes = async (parsedOutput, context) => {
459
+ const contents = map({});
460
+ const data = parsedOutput.body;
461
+ const doc = take(data, {
462
+ endpoint: __expectString,
463
+ error: __expectString,
464
+ error_description: __expectString,
465
+ region: __expectString,
466
+ });
467
+ Object.assign(contents, doc);
468
+ const exception = new InvalidRequestRegionException({
469
+ $metadata: deserializeMetadata(parsedOutput),
470
+ ...contents,
471
+ });
472
+ return __decorateServiceException(exception, parsedOutput.body);
473
+ };
353
474
  const de_InvalidScopeExceptionRes = async (parsedOutput, context) => {
354
475
  const contents = map({});
355
476
  const data = parsedOutput.body;
@@ -19,6 +19,7 @@ export const getRuntimeConfig = (config) => {
19
19
  runtime: "browser",
20
20
  defaultsMode,
21
21
  bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
22
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
22
23
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
23
24
  defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
24
25
  maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
@@ -1,5 +1,7 @@
1
1
  import packageInfo from "../package.json";
2
+ import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
2
3
  import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
4
+ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
3
5
  import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
4
6
  import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
5
7
  import { Hash } from "@smithy/hash-node";
@@ -24,6 +26,7 @@ export const getRuntimeConfig = (config) => {
24
26
  runtime: "node",
25
27
  defaultsMode,
26
28
  bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
29
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
27
30
  defaultUserAgentProvider: config?.defaultUserAgentProvider ??
28
31
  defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
29
32
  maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
@@ -1,5 +1,6 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
2
2
  import { CreateTokenCommandInput, CreateTokenCommandOutput } from "./commands/CreateTokenCommand";
3
+ import { CreateTokenWithIAMCommandInput, CreateTokenWithIAMCommandOutput } from "./commands/CreateTokenWithIAMCommand";
3
4
  import { RegisterClientCommandInput, RegisterClientCommandOutput } from "./commands/RegisterClientCommand";
4
5
  import { StartDeviceAuthorizationCommandInput, StartDeviceAuthorizationCommandOutput } from "./commands/StartDeviceAuthorizationCommand";
5
6
  import { SSOOIDCClient } from "./SSOOIDCClient";
@@ -10,6 +11,12 @@ export interface SSOOIDC {
10
11
  createToken(args: CreateTokenCommandInput, options?: __HttpHandlerOptions): Promise<CreateTokenCommandOutput>;
11
12
  createToken(args: CreateTokenCommandInput, cb: (err: any, data?: CreateTokenCommandOutput) => void): void;
12
13
  createToken(args: CreateTokenCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateTokenCommandOutput) => void): void;
14
+ /**
15
+ * @see {@link CreateTokenWithIAMCommand}
16
+ */
17
+ createTokenWithIAM(args: CreateTokenWithIAMCommandInput, options?: __HttpHandlerOptions): Promise<CreateTokenWithIAMCommandOutput>;
18
+ createTokenWithIAM(args: CreateTokenWithIAMCommandInput, cb: (err: any, data?: CreateTokenWithIAMCommandOutput) => void): void;
19
+ createTokenWithIAM(args: CreateTokenWithIAMCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateTokenWithIAMCommandOutput) => void): void;
13
20
  /**
14
21
  * @see {@link RegisterClientCommand}
15
22
  */
@@ -25,14 +32,12 @@ export interface SSOOIDC {
25
32
  }
26
33
  /**
27
34
  * @public
28
- * <p>AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI
35
+ * <p>IAM Identity Center OpenID Connect (OIDC) is a web service that enables a client (such as CLI
29
36
  * or a native application) to register with IAM Identity Center. The service also enables the client to
30
37
  * fetch the user’s access token upon successful authentication and authorization with
31
38
  * IAM Identity Center.</p>
32
39
  * <note>
33
- * <p>Although AWS Single Sign-On was renamed, the <code>sso</code> and
34
- * <code>identitystore</code> API namespaces will continue to retain their original name for
35
- * backward compatibility purposes. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed">IAM Identity Center rename</a>.</p>
40
+ * <p>IAM Identity Center uses the <code>sso</code> and <code>identitystore</code> API namespaces.</p>
36
41
  * </note>
37
42
  * <p>
38
43
  * <b>Considerations for Using This Guide</b>
@@ -41,23 +46,24 @@ export interface SSOOIDC {
41
46
  * important information about how the IAM Identity Center OIDC service works.</p>
42
47
  * <ul>
43
48
  * <li>
44
- * <p>The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0
45
- * Device Authorization Grant standard (<a href="https://tools.ietf.org/html/rfc8628">https://tools.ietf.org/html/rfc8628</a>) that are necessary to enable single
46
- * sign-on authentication with the AWS CLI. Support for other OIDC flows frequently needed
47
- * for native applications, such as Authorization Code Flow (+ PKCE), will be addressed in
48
- * future releases.</p>
49
+ * <p>The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0 Device
50
+ * Authorization Grant standard (<a href="https://tools.ietf.org/html/rfc8628">https://tools.ietf.org/html/rfc8628</a>) that are necessary to enable single
51
+ * sign-on authentication with the CLI. </p>
49
52
  * </li>
50
53
  * <li>
51
- * <p>The service emits only OIDC access tokens, such that obtaining a new token (For
52
- * example, token refresh) requires explicit user re-authentication.</p>
54
+ * <p>With older versions of the CLI, the service only emits OIDC access tokens, so to
55
+ * obtain a new token, users must explicitly re-authenticate. To access the OIDC flow that
56
+ * supports token refresh and doesn’t require re-authentication, update to the latest CLI
57
+ * version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with support for OIDC token refresh and
58
+ * configurable IAM Identity Center session durations. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html">Configure Amazon Web Services access portal session duration </a>. </p>
53
59
  * </li>
54
60
  * <li>
55
- * <p>The access tokens provided by this service grant access to all AWS account
61
+ * <p>The access tokens provided by this service grant access to all Amazon Web Services account
56
62
  * entitlements assigned to an IAM Identity Center user, not just a particular application.</p>
57
63
  * </li>
58
64
  * <li>
59
65
  * <p>The documentation in this guide does not describe the mechanism to convert the access
60
- * token into AWS Auth (“sigv4”) credentials for use with IAM-protected AWS service
66
+ * token into Amazon Web Services Auth (“sigv4”) credentials for use with IAM-protected Amazon Web Services service
61
67
  * endpoints. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html">GetRoleCredentials</a> in the <i>IAM Identity Center Portal API Reference
62
68
  * Guide</i>.</p>
63
69
  * </li>
@@ -1,5 +1,7 @@
1
1
  import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
2
+ import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
2
3
  import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
4
+ import { Credentials as __Credentials } from "@aws-sdk/types";
3
5
  import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
4
6
  import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
5
7
  import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
@@ -7,6 +9,7 @@ import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
7
9
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
8
10
  import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
9
11
  import { CreateTokenCommandInput, CreateTokenCommandOutput } from "./commands/CreateTokenCommand";
12
+ import { CreateTokenWithIAMCommandInput, CreateTokenWithIAMCommandOutput } from "./commands/CreateTokenWithIAMCommand";
10
13
  import { RegisterClientCommandInput, RegisterClientCommandOutput } from "./commands/RegisterClientCommand";
11
14
  import { StartDeviceAuthorizationCommandInput, StartDeviceAuthorizationCommandOutput } from "./commands/StartDeviceAuthorizationCommand";
12
15
  import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
@@ -15,11 +18,11 @@ export { __Client };
15
18
  /**
16
19
  * @public
17
20
  */
18
- export type ServiceInputTypes = CreateTokenCommandInput | RegisterClientCommandInput | StartDeviceAuthorizationCommandInput;
21
+ export type ServiceInputTypes = CreateTokenCommandInput | CreateTokenWithIAMCommandInput | RegisterClientCommandInput | StartDeviceAuthorizationCommandInput;
19
22
  /**
20
23
  * @public
21
24
  */
22
- export type ServiceOutputTypes = CreateTokenCommandOutput | RegisterClientCommandOutput | StartDeviceAuthorizationCommandOutput;
25
+ export type ServiceOutputTypes = CreateTokenCommandOutput | CreateTokenWithIAMCommandOutput | RegisterClientCommandOutput | StartDeviceAuthorizationCommandOutput;
23
26
  /**
24
27
  * @public
25
28
  */
@@ -96,6 +99,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
96
99
  * The AWS region to which this client will send requests
97
100
  */
98
101
  region?: string | __Provider<string>;
102
+ /**
103
+ * Default credentials provider; Not available in browser runtime.
104
+ * @internal
105
+ */
106
+ credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
99
107
  /**
100
108
  * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
101
109
  * @internal
@@ -127,7 +135,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
127
135
  /**
128
136
  * @public
129
137
  */
130
- export type SSOOIDCClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
138
+ export type SSOOIDCClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
131
139
  /**
132
140
  * @public
133
141
  *
@@ -138,7 +146,7 @@ export interface SSOOIDCClientConfig extends SSOOIDCClientConfigType {
138
146
  /**
139
147
  * @public
140
148
  */
141
- export type SSOOIDCClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
149
+ export type SSOOIDCClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
142
150
  /**
143
151
  * @public
144
152
  *
@@ -148,14 +156,12 @@ export interface SSOOIDCClientResolvedConfig extends SSOOIDCClientResolvedConfig
148
156
  }
149
157
  /**
150
158
  * @public
151
- * <p>AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI
159
+ * <p>IAM Identity Center OpenID Connect (OIDC) is a web service that enables a client (such as CLI
152
160
  * or a native application) to register with IAM Identity Center. The service also enables the client to
153
161
  * fetch the user’s access token upon successful authentication and authorization with
154
162
  * IAM Identity Center.</p>
155
163
  * <note>
156
- * <p>Although AWS Single Sign-On was renamed, the <code>sso</code> and
157
- * <code>identitystore</code> API namespaces will continue to retain their original name for
158
- * backward compatibility purposes. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed">IAM Identity Center rename</a>.</p>
164
+ * <p>IAM Identity Center uses the <code>sso</code> and <code>identitystore</code> API namespaces.</p>
159
165
  * </note>
160
166
  * <p>
161
167
  * <b>Considerations for Using This Guide</b>
@@ -164,23 +170,24 @@ export interface SSOOIDCClientResolvedConfig extends SSOOIDCClientResolvedConfig
164
170
  * important information about how the IAM Identity Center OIDC service works.</p>
165
171
  * <ul>
166
172
  * <li>
167
- * <p>The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0
168
- * Device Authorization Grant standard (<a href="https://tools.ietf.org/html/rfc8628">https://tools.ietf.org/html/rfc8628</a>) that are necessary to enable single
169
- * sign-on authentication with the AWS CLI. Support for other OIDC flows frequently needed
170
- * for native applications, such as Authorization Code Flow (+ PKCE), will be addressed in
171
- * future releases.</p>
173
+ * <p>The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0 Device
174
+ * Authorization Grant standard (<a href="https://tools.ietf.org/html/rfc8628">https://tools.ietf.org/html/rfc8628</a>) that are necessary to enable single
175
+ * sign-on authentication with the CLI. </p>
172
176
  * </li>
173
177
  * <li>
174
- * <p>The service emits only OIDC access tokens, such that obtaining a new token (For
175
- * example, token refresh) requires explicit user re-authentication.</p>
178
+ * <p>With older versions of the CLI, the service only emits OIDC access tokens, so to
179
+ * obtain a new token, users must explicitly re-authenticate. To access the OIDC flow that
180
+ * supports token refresh and doesn’t require re-authentication, update to the latest CLI
181
+ * version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with support for OIDC token refresh and
182
+ * configurable IAM Identity Center session durations. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html">Configure Amazon Web Services access portal session duration </a>. </p>
176
183
  * </li>
177
184
  * <li>
178
- * <p>The access tokens provided by this service grant access to all AWS account
185
+ * <p>The access tokens provided by this service grant access to all Amazon Web Services account
179
186
  * entitlements assigned to an IAM Identity Center user, not just a particular application.</p>
180
187
  * </li>
181
188
  * <li>
182
189
  * <p>The documentation in this guide does not describe the mechanism to convert the access
183
- * token into AWS Auth (“sigv4”) credentials for use with IAM-protected AWS service
190
+ * token into Amazon Web Services Auth (“sigv4”) credentials for use with IAM-protected Amazon Web Services service
184
191
  * endpoints. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html">GetRoleCredentials</a> in the <i>IAM Identity Center Portal API Reference
185
192
  * Guide</i>.</p>
186
193
  * </li>
@@ -23,9 +23,9 @@ export interface CreateTokenCommandOutput extends CreateTokenResponse, __Metadat
23
23
  }
24
24
  /**
25
25
  * @public
26
- * <p>Creates and returns an access token for the authorized client. The access token issued
27
- * will be used to fetch short-term credentials for the assigned roles in the AWS
28
- * account.</p>
26
+ * <p>Creates and returns access and refresh tokens for clients that are authenticated using
27
+ * client secrets. The access token can be used to fetch short-term credentials for the assigned
28
+ * AWS accounts or to access application APIs using <code>bearer</code> authentication.</p>
29
29
  * @example
30
30
  * Use a bare-bones client and the command you need to make an API call.
31
31
  * ```javascript
@@ -0,0 +1,140 @@
1
+ import { EndpointParameterInstructions } from "@smithy/middleware-endpoint";
2
+ import { Command as $Command } from "@smithy/smithy-client";
3
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@smithy/types";
4
+ import { CreateTokenWithIAMRequest, CreateTokenWithIAMResponse } from "../models/models_0";
5
+ import { ServiceInputTypes, ServiceOutputTypes, SSOOIDCClientResolvedConfig } from "../SSOOIDCClient";
6
+ /**
7
+ * @public
8
+ */
9
+ export { __MetadataBearer, $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link CreateTokenWithIAMCommand}.
14
+ */
15
+ export interface CreateTokenWithIAMCommandInput extends CreateTokenWithIAMRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link CreateTokenWithIAMCommand}.
21
+ */
22
+ export interface CreateTokenWithIAMCommandOutput extends CreateTokenWithIAMResponse, __MetadataBearer {
23
+ }
24
+ /**
25
+ * @public
26
+ * <p>Creates and returns access and refresh tokens for clients and applications that are
27
+ * authenticated using IAM entities. The access token can be used to fetch short-term credentials
28
+ * for the assigned AWS accounts or to access application APIs using <code>bearer</code>
29
+ * authentication.</p>
30
+ * @example
31
+ * Use a bare-bones client and the command you need to make an API call.
32
+ * ```javascript
33
+ * import { SSOOIDCClient, CreateTokenWithIAMCommand } from "@aws-sdk/client-sso-oidc"; // ES Modules import
34
+ * // const { SSOOIDCClient, CreateTokenWithIAMCommand } = require("@aws-sdk/client-sso-oidc"); // CommonJS import
35
+ * const client = new SSOOIDCClient(config);
36
+ * const input = { // CreateTokenWithIAMRequest
37
+ * clientId: "STRING_VALUE", // required
38
+ * grantType: "STRING_VALUE", // required
39
+ * code: "STRING_VALUE",
40
+ * refreshToken: "STRING_VALUE",
41
+ * assertion: "STRING_VALUE",
42
+ * scope: [ // Scopes
43
+ * "STRING_VALUE",
44
+ * ],
45
+ * redirectUri: "STRING_VALUE",
46
+ * subjectToken: "STRING_VALUE",
47
+ * subjectTokenType: "STRING_VALUE",
48
+ * requestedTokenType: "STRING_VALUE",
49
+ * };
50
+ * const command = new CreateTokenWithIAMCommand(input);
51
+ * const response = await client.send(command);
52
+ * // { // CreateTokenWithIAMResponse
53
+ * // accessToken: "STRING_VALUE",
54
+ * // tokenType: "STRING_VALUE",
55
+ * // expiresIn: Number("int"),
56
+ * // refreshToken: "STRING_VALUE",
57
+ * // idToken: "STRING_VALUE",
58
+ * // issuedTokenType: "STRING_VALUE",
59
+ * // scope: [ // Scopes
60
+ * // "STRING_VALUE",
61
+ * // ],
62
+ * // };
63
+ *
64
+ * ```
65
+ *
66
+ * @param CreateTokenWithIAMCommandInput - {@link CreateTokenWithIAMCommandInput}
67
+ * @returns {@link CreateTokenWithIAMCommandOutput}
68
+ * @see {@link CreateTokenWithIAMCommandInput} for command's `input` shape.
69
+ * @see {@link CreateTokenWithIAMCommandOutput} for command's `response` shape.
70
+ * @see {@link SSOOIDCClientResolvedConfig | config} for SSOOIDCClient's `config` shape.
71
+ *
72
+ * @throws {@link AccessDeniedException} (client fault)
73
+ * <p>You do not have sufficient access to perform this action.</p>
74
+ *
75
+ * @throws {@link AuthorizationPendingException} (client fault)
76
+ * <p>Indicates that a request to authorize a client with an access user session token is
77
+ * pending.</p>
78
+ *
79
+ * @throws {@link ExpiredTokenException} (client fault)
80
+ * <p>Indicates that the token issued by the service is expired and is no longer valid.</p>
81
+ *
82
+ * @throws {@link InternalServerException} (server fault)
83
+ * <p>Indicates that an error from the service occurred while trying to process a
84
+ * request.</p>
85
+ *
86
+ * @throws {@link InvalidClientException} (client fault)
87
+ * <p>Indicates that the <code>clientId</code> or <code>clientSecret</code> in the request is
88
+ * invalid. For example, this can occur when a client sends an incorrect <code>clientId</code> or
89
+ * an expired <code>clientSecret</code>.</p>
90
+ *
91
+ * @throws {@link InvalidGrantException} (client fault)
92
+ * <p>Indicates that a request contains an invalid grant. This can occur if a client makes a
93
+ * <a>CreateToken</a> request with an invalid grant type.</p>
94
+ *
95
+ * @throws {@link InvalidRequestException} (client fault)
96
+ * <p>Indicates that something is wrong with the input to the request. For example, a required
97
+ * parameter might be missing or out of range.</p>
98
+ *
99
+ * @throws {@link InvalidRequestRegionException} (client fault)
100
+ * <p>Indicates that a token provided as input to the request was issued by and is only usable
101
+ * by calling IAM Identity Center endpoints in another region.</p>
102
+ *
103
+ * @throws {@link InvalidScopeException} (client fault)
104
+ * <p>Indicates that the scope provided in the request is invalid.</p>
105
+ *
106
+ * @throws {@link SlowDownException} (client fault)
107
+ * <p>Indicates that the client is making the request too frequently and is more than the
108
+ * service can handle. </p>
109
+ *
110
+ * @throws {@link UnauthorizedClientException} (client fault)
111
+ * <p>Indicates that the client is not currently authorized to make the request. This can happen
112
+ * when a <code>clientId</code> is not issued for a public client.</p>
113
+ *
114
+ * @throws {@link UnsupportedGrantTypeException} (client fault)
115
+ * <p>Indicates that the grant type in the request is not supported by the service.</p>
116
+ *
117
+ * @throws {@link SSOOIDCServiceException}
118
+ * <p>Base exception class for all service exceptions from SSOOIDC service.</p>
119
+ *
120
+ */
121
+ export declare class CreateTokenWithIAMCommand extends $Command<CreateTokenWithIAMCommandInput, CreateTokenWithIAMCommandOutput, SSOOIDCClientResolvedConfig> {
122
+ readonly input: CreateTokenWithIAMCommandInput;
123
+ static getEndpointParameterInstructions(): EndpointParameterInstructions;
124
+ /**
125
+ * @public
126
+ */
127
+ constructor(input: CreateTokenWithIAMCommandInput);
128
+ /**
129
+ * @internal
130
+ */
131
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: SSOOIDCClientResolvedConfig, options?: __HttpHandlerOptions): Handler<CreateTokenWithIAMCommandInput, CreateTokenWithIAMCommandOutput>;
132
+ /**
133
+ * @internal
134
+ */
135
+ private serialize;
136
+ /**
137
+ * @internal
138
+ */
139
+ private deserialize;
140
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./CreateTokenCommand";
2
+ export * from "./CreateTokenWithIAMCommand";
2
3
  export * from "./RegisterClientCommand";
3
4
  export * from "./StartDeviceAuthorizationCommand";
@@ -1,12 +1,10 @@
1
1
  /**
2
- * <p>AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC) is a web service that enables a client (such as AWS CLI
2
+ * <p>IAM Identity Center OpenID Connect (OIDC) is a web service that enables a client (such as CLI
3
3
  * or a native application) to register with IAM Identity Center. The service also enables the client to
4
4
  * fetch the user’s access token upon successful authentication and authorization with
5
5
  * IAM Identity Center.</p>
6
6
  * <note>
7
- * <p>Although AWS Single Sign-On was renamed, the <code>sso</code> and
8
- * <code>identitystore</code> API namespaces will continue to retain their original name for
9
- * backward compatibility purposes. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed">IAM Identity Center rename</a>.</p>
7
+ * <p>IAM Identity Center uses the <code>sso</code> and <code>identitystore</code> API namespaces.</p>
10
8
  * </note>
11
9
  * <p>
12
10
  * <b>Considerations for Using This Guide</b>
@@ -15,23 +13,24 @@
15
13
  * important information about how the IAM Identity Center OIDC service works.</p>
16
14
  * <ul>
17
15
  * <li>
18
- * <p>The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0
19
- * Device Authorization Grant standard (<a href="https://tools.ietf.org/html/rfc8628">https://tools.ietf.org/html/rfc8628</a>) that are necessary to enable single
20
- * sign-on authentication with the AWS CLI. Support for other OIDC flows frequently needed
21
- * for native applications, such as Authorization Code Flow (+ PKCE), will be addressed in
22
- * future releases.</p>
16
+ * <p>The IAM Identity Center OIDC service currently implements only the portions of the OAuth 2.0 Device
17
+ * Authorization Grant standard (<a href="https://tools.ietf.org/html/rfc8628">https://tools.ietf.org/html/rfc8628</a>) that are necessary to enable single
18
+ * sign-on authentication with the CLI. </p>
23
19
  * </li>
24
20
  * <li>
25
- * <p>The service emits only OIDC access tokens, such that obtaining a new token (For
26
- * example, token refresh) requires explicit user re-authentication.</p>
21
+ * <p>With older versions of the CLI, the service only emits OIDC access tokens, so to
22
+ * obtain a new token, users must explicitly re-authenticate. To access the OIDC flow that
23
+ * supports token refresh and doesn’t require re-authentication, update to the latest CLI
24
+ * version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with support for OIDC token refresh and
25
+ * configurable IAM Identity Center session durations. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html">Configure Amazon Web Services access portal session duration </a>. </p>
27
26
  * </li>
28
27
  * <li>
29
- * <p>The access tokens provided by this service grant access to all AWS account
28
+ * <p>The access tokens provided by this service grant access to all Amazon Web Services account
30
29
  * entitlements assigned to an IAM Identity Center user, not just a particular application.</p>
31
30
  * </li>
32
31
  * <li>
33
32
  * <p>The documentation in this guide does not describe the mechanism to convert the access
34
- * token into AWS Auth (“sigv4”) credentials for use with IAM-protected AWS service
33
+ * token into Amazon Web Services Auth (“sigv4”) credentials for use with IAM-protected Amazon Web Services service
35
34
  * endpoints. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html">GetRoleCredentials</a> in the <i>IAM Identity Center Portal API Reference
36
35
  * Guide</i>.</p>
37
36
  * </li>