@aws-sdk/client-sso-oidc 3.451.0 → 3.455.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 (48) 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 +50 -3
  29. package/dist-types/commands/CreateTokenWithIAMCommand.d.ts +258 -0
  30. package/dist-types/commands/RegisterClientCommand.d.ts +24 -0
  31. package/dist-types/commands/StartDeviceAuthorizationCommand.d.ts +23 -0
  32. package/dist-types/commands/index.d.ts +1 -0
  33. package/dist-types/index.d.ts +12 -13
  34. package/dist-types/models/models_0.d.ts +364 -36
  35. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  36. package/dist-types/runtimeConfig.browser.d.ts +7 -0
  37. package/dist-types/runtimeConfig.d.ts +7 -0
  38. package/dist-types/runtimeConfig.native.d.ts +7 -0
  39. package/dist-types/ts3.4/SSOOIDC.d.ts +17 -0
  40. package/dist-types/ts3.4/SSOOIDCClient.d.ts +14 -0
  41. package/dist-types/ts3.4/commands/CreateTokenWithIAMCommand.d.ts +39 -0
  42. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  43. package/dist-types/ts3.4/models/models_0.d.ts +50 -0
  44. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
  45. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +24 -0
  46. package/dist-types/ts3.4/runtimeConfig.d.ts +24 -0
  47. package/dist-types/ts3.4/runtimeConfig.native.d.ts +24 -0
  48. 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
@@ -106,6 +106,53 @@ export interface CreateTokenCommandOutput extends CreateTokenResponse, __Metadat
106
106
  * @throws {@link SSOOIDCServiceException}
107
107
  * <p>Base exception class for all service exceptions from SSOOIDC service.</p>
108
108
  *
109
+ * @example Call OAuth/OIDC /token endpoint for Device Code grant with Secret authentication
110
+ * ```javascript
111
+ * //
112
+ * const input = {
113
+ * "clientId": "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID",
114
+ * "clientSecret": "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0",
115
+ * "deviceCode": "yJraWQiOiJrZXktMTU2Njk2ODA4OCIsImFsZyI6IkhTMzIn0EXAMPLEDEVICECODE",
116
+ * "grantType": "urn:ietf:params:oauth:grant-type:device-code"
117
+ * };
118
+ * const command = new CreateTokenCommand(input);
119
+ * const response = await client.send(command);
120
+ * /* response ==
121
+ * {
122
+ * "accessToken": "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
123
+ * "expiresIn": 1579729529,
124
+ * "refreshToken": "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
125
+ * "tokenType": "Bearer"
126
+ * }
127
+ * *\/
128
+ * // example id: create-token-for-device-code
129
+ * ```
130
+ *
131
+ * @example Call OAuth/OIDC /token endpoint for Refresh Token grant with Secret authentication
132
+ * ```javascript
133
+ * //
134
+ * const input = {
135
+ * "clientId": "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID",
136
+ * "clientSecret": "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0",
137
+ * "grantType": "refresh_token",
138
+ * "refreshToken": "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
139
+ * "scope": [
140
+ * "codewhisperer:completions"
141
+ * ]
142
+ * };
143
+ * const command = new CreateTokenCommand(input);
144
+ * const response = await client.send(command);
145
+ * /* response ==
146
+ * {
147
+ * "accessToken": "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
148
+ * "expiresIn": 1579729529,
149
+ * "refreshToken": "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
150
+ * "tokenType": "Bearer"
151
+ * }
152
+ * *\/
153
+ * // example id: create-token-for-refresh-token
154
+ * ```
155
+ *
109
156
  */
110
157
  export declare class CreateTokenCommand extends $Command<CreateTokenCommandInput, CreateTokenCommandOutput, SSOOIDCClientResolvedConfig> {
111
158
  readonly input: CreateTokenCommandInput;