aws-sdk-core 3.117.0 → 3.197.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +836 -0
- data/VERSION +1 -1
- data/lib/aws-defaults/default_configuration.rb +153 -0
- data/lib/aws-defaults/defaults_mode_config_resolver.rb +107 -0
- data/lib/aws-defaults.rb +3 -0
- data/lib/aws-sdk-core/arn.rb +13 -0
- data/lib/aws-sdk-core/assume_role_credentials.rb +21 -7
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +14 -10
- data/lib/aws-sdk-core/binary/decode_handler.rb +0 -5
- data/lib/aws-sdk-core/binary/encode_handler.rb +12 -1
- data/lib/aws-sdk-core/binary/event_builder.rb +34 -37
- data/lib/aws-sdk-core/client_stubs.rb +20 -13
- data/lib/aws-sdk-core/credential_provider.rb +4 -1
- data/lib/aws-sdk-core/credential_provider_chain.rb +8 -5
- data/lib/aws-sdk-core/ec2_metadata.rb +4 -3
- data/lib/aws-sdk-core/ecs_credentials.rb +187 -52
- data/lib/aws-sdk-core/endpoints/condition.rb +41 -0
- data/lib/aws-sdk-core/endpoints/endpoint.rb +17 -0
- data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +75 -0
- data/lib/aws-sdk-core/endpoints/error_rule.rb +42 -0
- data/lib/aws-sdk-core/endpoints/function.rb +80 -0
- data/lib/aws-sdk-core/endpoints/matchers.rb +135 -0
- data/lib/aws-sdk-core/endpoints/reference.rb +31 -0
- data/lib/aws-sdk-core/endpoints/rule.rb +25 -0
- data/lib/aws-sdk-core/endpoints/rule_set.rb +52 -0
- data/lib/aws-sdk-core/endpoints/rules_provider.rb +37 -0
- data/lib/aws-sdk-core/endpoints/templater.rb +58 -0
- data/lib/aws-sdk-core/endpoints/tree_rule.rb +45 -0
- data/lib/aws-sdk-core/endpoints/url.rb +60 -0
- data/lib/aws-sdk-core/endpoints.rb +78 -0
- data/lib/aws-sdk-core/errors.rb +17 -4
- data/lib/aws-sdk-core/event_emitter.rb +0 -16
- data/lib/aws-sdk-core/ini_parser.rb +7 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +127 -33
- data/lib/aws-sdk-core/json/builder.rb +8 -1
- data/lib/aws-sdk-core/json/error_handler.rb +30 -4
- data/lib/aws-sdk-core/json/handler.rb +8 -1
- data/lib/aws-sdk-core/json/json_engine.rb +10 -8
- data/lib/aws-sdk-core/json/oj_engine.rb +33 -6
- data/lib/aws-sdk-core/json/parser.rb +38 -2
- data/lib/aws-sdk-core/json.rb +8 -26
- data/lib/aws-sdk-core/log/formatter.rb +6 -0
- data/lib/aws-sdk-core/log/param_filter.rb +9 -1
- data/lib/aws-sdk-core/lru_cache.rb +75 -0
- data/lib/aws-sdk-core/pageable_response.rb +81 -32
- data/lib/aws-sdk-core/param_validator.rb +36 -2
- data/lib/aws-sdk-core/plugins/bearer_authorization.rb +67 -0
- data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +342 -0
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +1 -0
- data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +14 -2
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +29 -1
- data/lib/aws-sdk-core/plugins/defaults_mode.rb +40 -0
- data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +6 -2
- data/lib/aws-sdk-core/plugins/http_checksum.rb +9 -1
- data/lib/aws-sdk-core/plugins/invocation_id.rb +1 -11
- data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +34 -6
- data/lib/aws-sdk-core/plugins/logging.rb +2 -0
- data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +17 -0
- data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +4 -2
- data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +1 -2
- data/lib/aws-sdk-core/plugins/recursion_detection.rb +38 -0
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +144 -17
- data/lib/aws-sdk-core/plugins/request_compression.rb +226 -0
- data/lib/aws-sdk-core/plugins/response_paging.rb +1 -1
- data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +7 -4
- data/lib/aws-sdk-core/plugins/retry_errors.rb +33 -7
- data/lib/aws-sdk-core/plugins/sign.rb +211 -0
- data/lib/aws-sdk-core/plugins/signature_v2.rb +1 -0
- data/lib/aws-sdk-core/plugins/signature_v4.rb +28 -31
- data/lib/aws-sdk-core/plugins/stub_responses.rb +6 -1
- data/lib/aws-sdk-core/plugins/user_agent.rb +152 -14
- data/lib/aws-sdk-core/process_credentials.rb +50 -34
- data/lib/aws-sdk-core/query/ec2_param_builder.rb +5 -7
- data/lib/aws-sdk-core/query/param_builder.rb +2 -2
- data/lib/aws-sdk-core/refreshing_credentials.rb +49 -18
- data/lib/aws-sdk-core/refreshing_token.rb +71 -0
- data/lib/aws-sdk-core/rest/handler.rb +1 -1
- data/lib/aws-sdk-core/rest/request/body.rb +49 -4
- data/lib/aws-sdk-core/rest/request/content_type.rb +60 -0
- data/lib/aws-sdk-core/rest/request/endpoint.rb +24 -4
- data/lib/aws-sdk-core/rest/request/headers.rb +23 -7
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +62 -36
- data/lib/aws-sdk-core/rest/response/body.rb +15 -1
- data/lib/aws-sdk-core/rest/response/header_list_parser.rb +79 -0
- data/lib/aws-sdk-core/rest/response/headers.rb +10 -3
- data/lib/aws-sdk-core/rest.rb +1 -0
- data/lib/aws-sdk-core/shared_config.rb +112 -12
- data/lib/aws-sdk-core/sso_credentials.rb +92 -51
- data/lib/aws-sdk-core/sso_token_provider.rb +135 -0
- data/lib/aws-sdk-core/static_token_provider.rb +14 -0
- data/lib/aws-sdk-core/structure.rb +16 -5
- data/lib/aws-sdk-core/stubbing/stub_data.rb +11 -0
- data/lib/aws-sdk-core/token.rb +31 -0
- data/lib/aws-sdk-core/token_provider.rb +15 -0
- data/lib/aws-sdk-core/token_provider_chain.rb +51 -0
- data/lib/aws-sdk-core/util.rb +39 -0
- data/lib/aws-sdk-core/waiters/poller.rb +4 -2
- data/lib/aws-sdk-core/xml/builder.rb +17 -9
- data/lib/aws-sdk-core/xml/error_handler.rb +31 -8
- data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
- data/lib/aws-sdk-core/xml/parser/engines/ox.rb +1 -1
- data/lib/aws-sdk-core/xml/parser/engines/rexml.rb +0 -8
- data/lib/aws-sdk-core/xml/parser/frame.rb +27 -20
- data/lib/aws-sdk-core/xml/parser/stack.rb +2 -0
- data/lib/aws-sdk-core.rb +21 -0
- data/lib/aws-sdk-sso/client.rb +157 -50
- data/lib/aws-sdk-sso/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sso/endpoint_provider.rb +57 -0
- data/lib/aws-sdk-sso/endpoints.rb +72 -0
- data/lib/aws-sdk-sso/plugins/endpoints.rb +78 -0
- data/lib/aws-sdk-sso/types.rb +8 -43
- data/lib/aws-sdk-sso.rb +5 -1
- data/lib/aws-sdk-ssooidc/client.rb +1008 -0
- data/lib/aws-sdk-ssooidc/client_api.rb +293 -0
- data/lib/aws-sdk-ssooidc/customizations.rb +1 -0
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-ssooidc/endpoint_provider.rb +57 -0
- data/lib/aws-sdk-ssooidc/endpoints.rb +72 -0
- data/lib/aws-sdk-ssooidc/errors.rb +342 -0
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +78 -0
- data/lib/aws-sdk-ssooidc/resource.rb +26 -0
- data/lib/aws-sdk-ssooidc/types.rb +823 -0
- data/lib/aws-sdk-ssooidc.rb +59 -0
- data/lib/aws-sdk-sts/client.rb +472 -398
- data/lib/aws-sdk-sts/client_api.rb +20 -9
- data/lib/aws-sdk-sts/endpoint_parameters.rb +78 -0
- data/lib/aws-sdk-sts/endpoint_provider.rb +112 -0
- data/lib/aws-sdk-sts/endpoints.rb +136 -0
- data/lib/aws-sdk-sts/plugins/endpoints.rb +86 -0
- data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +5 -1
- data/lib/aws-sdk-sts/presigner.rb +14 -10
- data/lib/aws-sdk-sts/types.rb +168 -227
- data/lib/aws-sdk-sts.rb +5 -1
- data/lib/seahorse/client/async_base.rb +1 -2
- data/lib/seahorse/client/async_response.rb +19 -0
- data/lib/seahorse/client/base.rb +1 -0
- data/lib/seahorse/client/configuration.rb +5 -5
- data/lib/seahorse/client/h2/connection.rb +15 -16
- data/lib/seahorse/client/h2/handler.rb +5 -5
- data/lib/seahorse/client/net_http/connection_pool.rb +10 -9
- data/lib/seahorse/client/net_http/handler.rb +15 -7
- data/lib/seahorse/client/net_http/patches.rb +12 -86
- data/lib/seahorse/client/plugin.rb +9 -0
- data/lib/seahorse/client/plugins/content_length.rb +11 -5
- data/lib/seahorse/client/plugins/h2.rb +3 -3
- data/lib/seahorse/client/plugins/net_http.rb +73 -10
- data/lib/seahorse/client/plugins/request_callback.rb +40 -9
- data/lib/seahorse/client/response.rb +6 -0
- data/lib/seahorse/model/operation.rb +6 -0
- data/lib/seahorse/model/shapes.rb +27 -2
- data/lib/seahorse/util.rb +4 -0
- data/sig/aws-sdk-core/client_stubs.rbs +10 -0
- data/sig/aws-sdk-core/errors.rbs +22 -0
- data/sig/aws-sdk-core/resources/collection.rbs +21 -0
- data/sig/aws-sdk-core/structure.rbs +4 -0
- data/sig/aws-sdk-core/waiters/errors.rbs +20 -0
- data/sig/aws-sdk-core.rbs +7 -0
- data/sig/seahorse/client/base.rbs +25 -0
- data/sig/seahorse/client/handler_builder.rbs +16 -0
- data/sig/seahorse/client/response.rbs +61 -0
- metadata +82 -17
- data/lib/aws-sdk-sso/plugins/content_type.rb +0 -25
@@ -0,0 +1,1008 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
require 'seahorse/client/plugins/content_length.rb'
|
11
|
+
require 'aws-sdk-core/plugins/credentials_configuration.rb'
|
12
|
+
require 'aws-sdk-core/plugins/logging.rb'
|
13
|
+
require 'aws-sdk-core/plugins/param_converter.rb'
|
14
|
+
require 'aws-sdk-core/plugins/param_validator.rb'
|
15
|
+
require 'aws-sdk-core/plugins/user_agent.rb'
|
16
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
17
|
+
require 'aws-sdk-core/plugins/retry_errors.rb'
|
18
|
+
require 'aws-sdk-core/plugins/global_configuration.rb'
|
19
|
+
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
20
|
+
require 'aws-sdk-core/plugins/endpoint_discovery.rb'
|
21
|
+
require 'aws-sdk-core/plugins/endpoint_pattern.rb'
|
22
|
+
require 'aws-sdk-core/plugins/response_paging.rb'
|
23
|
+
require 'aws-sdk-core/plugins/stub_responses.rb'
|
24
|
+
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
25
|
+
require 'aws-sdk-core/plugins/invocation_id.rb'
|
26
|
+
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
|
27
|
+
require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
|
28
|
+
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
|
29
|
+
require 'aws-sdk-core/plugins/transfer_encoding.rb'
|
30
|
+
require 'aws-sdk-core/plugins/http_checksum.rb'
|
31
|
+
require 'aws-sdk-core/plugins/checksum_algorithm.rb'
|
32
|
+
require 'aws-sdk-core/plugins/request_compression.rb'
|
33
|
+
require 'aws-sdk-core/plugins/defaults_mode.rb'
|
34
|
+
require 'aws-sdk-core/plugins/recursion_detection.rb'
|
35
|
+
require 'aws-sdk-core/plugins/sign.rb'
|
36
|
+
require 'aws-sdk-core/plugins/protocols/rest_json.rb'
|
37
|
+
|
38
|
+
Aws::Plugins::GlobalConfiguration.add_identifier(:ssooidc)
|
39
|
+
|
40
|
+
module Aws::SSOOIDC
|
41
|
+
# An API client for SSOOIDC. To construct a client, you need to configure a `:region` and `:credentials`.
|
42
|
+
#
|
43
|
+
# client = Aws::SSOOIDC::Client.new(
|
44
|
+
# region: region_name,
|
45
|
+
# credentials: credentials,
|
46
|
+
# # ...
|
47
|
+
# )
|
48
|
+
#
|
49
|
+
# For details on configuring region and credentials see
|
50
|
+
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
|
51
|
+
#
|
52
|
+
# See {#initialize} for a full list of supported configuration options.
|
53
|
+
class Client < Seahorse::Client::Base
|
54
|
+
|
55
|
+
include Aws::ClientStubs
|
56
|
+
|
57
|
+
@identifier = :ssooidc
|
58
|
+
|
59
|
+
set_api(ClientApi::API)
|
60
|
+
|
61
|
+
add_plugin(Seahorse::Client::Plugins::ContentLength)
|
62
|
+
add_plugin(Aws::Plugins::CredentialsConfiguration)
|
63
|
+
add_plugin(Aws::Plugins::Logging)
|
64
|
+
add_plugin(Aws::Plugins::ParamConverter)
|
65
|
+
add_plugin(Aws::Plugins::ParamValidator)
|
66
|
+
add_plugin(Aws::Plugins::UserAgent)
|
67
|
+
add_plugin(Aws::Plugins::HelpfulSocketErrors)
|
68
|
+
add_plugin(Aws::Plugins::RetryErrors)
|
69
|
+
add_plugin(Aws::Plugins::GlobalConfiguration)
|
70
|
+
add_plugin(Aws::Plugins::RegionalEndpoint)
|
71
|
+
add_plugin(Aws::Plugins::EndpointDiscovery)
|
72
|
+
add_plugin(Aws::Plugins::EndpointPattern)
|
73
|
+
add_plugin(Aws::Plugins::ResponsePaging)
|
74
|
+
add_plugin(Aws::Plugins::StubResponses)
|
75
|
+
add_plugin(Aws::Plugins::IdempotencyToken)
|
76
|
+
add_plugin(Aws::Plugins::InvocationId)
|
77
|
+
add_plugin(Aws::Plugins::JsonvalueConverter)
|
78
|
+
add_plugin(Aws::Plugins::ClientMetricsPlugin)
|
79
|
+
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
|
80
|
+
add_plugin(Aws::Plugins::TransferEncoding)
|
81
|
+
add_plugin(Aws::Plugins::HttpChecksum)
|
82
|
+
add_plugin(Aws::Plugins::ChecksumAlgorithm)
|
83
|
+
add_plugin(Aws::Plugins::RequestCompression)
|
84
|
+
add_plugin(Aws::Plugins::DefaultsMode)
|
85
|
+
add_plugin(Aws::Plugins::RecursionDetection)
|
86
|
+
add_plugin(Aws::Plugins::Sign)
|
87
|
+
add_plugin(Aws::Plugins::Protocols::RestJson)
|
88
|
+
add_plugin(Aws::SSOOIDC::Plugins::Endpoints)
|
89
|
+
|
90
|
+
# @overload initialize(options)
|
91
|
+
# @param [Hash] options
|
92
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
93
|
+
# Your AWS credentials. This can be an instance of any one of the
|
94
|
+
# following classes:
|
95
|
+
#
|
96
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
97
|
+
# credentials.
|
98
|
+
#
|
99
|
+
# * `Aws::SharedCredentials` - Used for loading static credentials from a
|
100
|
+
# shared file, such as `~/.aws/config`.
|
101
|
+
#
|
102
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
103
|
+
#
|
104
|
+
# * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
|
105
|
+
# assume a role after providing credentials via the web.
|
106
|
+
#
|
107
|
+
# * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
|
108
|
+
# access token generated from `aws login`.
|
109
|
+
#
|
110
|
+
# * `Aws::ProcessCredentials` - Used for loading credentials from a
|
111
|
+
# process that outputs to stdout.
|
112
|
+
#
|
113
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
114
|
+
# from an EC2 IMDS on an EC2 instance.
|
115
|
+
#
|
116
|
+
# * `Aws::ECSCredentials` - Used for loading credentials from
|
117
|
+
# instances running in ECS.
|
118
|
+
#
|
119
|
+
# * `Aws::CognitoIdentityCredentials` - Used for loading credentials
|
120
|
+
# from the Cognito Identity service.
|
121
|
+
#
|
122
|
+
# When `:credentials` are not configured directly, the following
|
123
|
+
# locations will be searched for credentials:
|
124
|
+
#
|
125
|
+
# * `Aws.config[:credentials]`
|
126
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
127
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
128
|
+
# * `~/.aws/credentials`
|
129
|
+
# * `~/.aws/config`
|
130
|
+
# * EC2/ECS IMDS instance profile - When used by default, the timeouts
|
131
|
+
# are very aggressive. Construct and pass an instance of
|
132
|
+
# `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
|
133
|
+
# enable retries and extended timeouts. Instance profile credential
|
134
|
+
# fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
|
135
|
+
# to true.
|
136
|
+
#
|
137
|
+
# @option options [required, String] :region
|
138
|
+
# The AWS region to connect to. The configured `:region` is
|
139
|
+
# used to determine the service `:endpoint`. When not passed,
|
140
|
+
# a default `:region` is searched for in the following locations:
|
141
|
+
#
|
142
|
+
# * `Aws.config[:region]`
|
143
|
+
# * `ENV['AWS_REGION']`
|
144
|
+
# * `ENV['AMAZON_REGION']`
|
145
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
146
|
+
# * `~/.aws/credentials`
|
147
|
+
# * `~/.aws/config`
|
148
|
+
#
|
149
|
+
# @option options [String] :access_key_id
|
150
|
+
#
|
151
|
+
# @option options [Boolean] :active_endpoint_cache (false)
|
152
|
+
# When set to `true`, a thread polling for endpoints will be running in
|
153
|
+
# the background every 60 secs (default). Defaults to `false`.
|
154
|
+
#
|
155
|
+
# @option options [Boolean] :adaptive_retry_wait_to_fill (true)
|
156
|
+
# Used only in `adaptive` retry mode. When true, the request will sleep
|
157
|
+
# until there is sufficent client side capacity to retry the request.
|
158
|
+
# When false, the request will raise a `RetryCapacityNotAvailableError` and will
|
159
|
+
# not retry instead of sleeping.
|
160
|
+
#
|
161
|
+
# @option options [Boolean] :client_side_monitoring (false)
|
162
|
+
# When `true`, client-side metrics will be collected for all API requests from
|
163
|
+
# this client.
|
164
|
+
#
|
165
|
+
# @option options [String] :client_side_monitoring_client_id ("")
|
166
|
+
# Allows you to provide an identifier for this client which will be attached to
|
167
|
+
# all generated client side metrics. Defaults to an empty string.
|
168
|
+
#
|
169
|
+
# @option options [String] :client_side_monitoring_host ("127.0.0.1")
|
170
|
+
# Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
|
171
|
+
# side monitoring agent is running on, where client metrics will be published via UDP.
|
172
|
+
#
|
173
|
+
# @option options [Integer] :client_side_monitoring_port (31000)
|
174
|
+
# Required for publishing client metrics. The port that the client side monitoring
|
175
|
+
# agent is running on, where client metrics will be published via UDP.
|
176
|
+
#
|
177
|
+
# @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
|
178
|
+
# Allows you to provide a custom client-side monitoring publisher class. By default,
|
179
|
+
# will use the Client Side Monitoring Agent Publisher.
|
180
|
+
#
|
181
|
+
# @option options [Boolean] :convert_params (true)
|
182
|
+
# When `true`, an attempt is made to coerce request parameters into
|
183
|
+
# the required types.
|
184
|
+
#
|
185
|
+
# @option options [Boolean] :correct_clock_skew (true)
|
186
|
+
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
|
187
|
+
# a clock skew correction and retry requests with skewed client clocks.
|
188
|
+
#
|
189
|
+
# @option options [String] :defaults_mode ("legacy")
|
190
|
+
# See {Aws::DefaultsModeConfiguration} for a list of the
|
191
|
+
# accepted modes and the configuration defaults that are included.
|
192
|
+
#
|
193
|
+
# @option options [Boolean] :disable_host_prefix_injection (false)
|
194
|
+
# Set to true to disable SDK automatically adding host prefix
|
195
|
+
# to default service endpoint when available.
|
196
|
+
#
|
197
|
+
# @option options [Boolean] :disable_request_compression (false)
|
198
|
+
# When set to 'true' the request body will not be compressed
|
199
|
+
# for supported operations.
|
200
|
+
#
|
201
|
+
# @option options [String, URI::HTTPS, URI::HTTP] :endpoint
|
202
|
+
# Normally you should not configure the `:endpoint` option
|
203
|
+
# directly. This is normally constructed from the `:region`
|
204
|
+
# option. Configuring `:endpoint` is normally reserved for
|
205
|
+
# connecting to test or custom endpoints. The endpoint should
|
206
|
+
# be a URI formatted like:
|
207
|
+
#
|
208
|
+
# 'http://example.com'
|
209
|
+
# 'https://example.com'
|
210
|
+
# 'http://example.com:123'
|
211
|
+
#
|
212
|
+
#
|
213
|
+
# @option options [Integer] :endpoint_cache_max_entries (1000)
|
214
|
+
# Used for the maximum size limit of the LRU cache storing endpoints data
|
215
|
+
# for endpoint discovery enabled operations. Defaults to 1000.
|
216
|
+
#
|
217
|
+
# @option options [Integer] :endpoint_cache_max_threads (10)
|
218
|
+
# Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
|
219
|
+
#
|
220
|
+
# @option options [Integer] :endpoint_cache_poll_interval (60)
|
221
|
+
# When :endpoint_discovery and :active_endpoint_cache is enabled,
|
222
|
+
# Use this option to config the time interval in seconds for making
|
223
|
+
# requests fetching endpoints information. Defaults to 60 sec.
|
224
|
+
#
|
225
|
+
# @option options [Boolean] :endpoint_discovery (false)
|
226
|
+
# When set to `true`, endpoint discovery will be enabled for operations when available.
|
227
|
+
#
|
228
|
+
# @option options [Boolean] :ignore_configured_endpoint_urls
|
229
|
+
# Setting to true disables use of endpoint URLs provided via environment
|
230
|
+
# variables and the shared configuration file.
|
231
|
+
#
|
232
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
233
|
+
# The log formatter.
|
234
|
+
#
|
235
|
+
# @option options [Symbol] :log_level (:info)
|
236
|
+
# The log level to send messages to the `:logger` at.
|
237
|
+
#
|
238
|
+
# @option options [Logger] :logger
|
239
|
+
# The Logger instance to send log messages to. If this option
|
240
|
+
# is not set, logging will be disabled.
|
241
|
+
#
|
242
|
+
# @option options [Integer] :max_attempts (3)
|
243
|
+
# An integer representing the maximum number attempts that will be made for
|
244
|
+
# a single request, including the initial attempt. For example,
|
245
|
+
# setting this value to 5 will result in a request being retried up to
|
246
|
+
# 4 times. Used in `standard` and `adaptive` retry modes.
|
247
|
+
#
|
248
|
+
# @option options [String] :profile ("default")
|
249
|
+
# Used when loading credentials from the shared credentials file
|
250
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
251
|
+
#
|
252
|
+
# @option options [Integer] :request_min_compression_size_bytes (10240)
|
253
|
+
# The minimum size in bytes that triggers compression for request
|
254
|
+
# bodies. The value must be non-negative integer value between 0
|
255
|
+
# and 10485780 bytes inclusive.
|
256
|
+
#
|
257
|
+
# @option options [Proc] :retry_backoff
|
258
|
+
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
|
259
|
+
# This option is only used in the `legacy` retry mode.
|
260
|
+
#
|
261
|
+
# @option options [Float] :retry_base_delay (0.3)
|
262
|
+
# The base delay in seconds used by the default backoff function. This option
|
263
|
+
# is only used in the `legacy` retry mode.
|
264
|
+
#
|
265
|
+
# @option options [Symbol] :retry_jitter (:none)
|
266
|
+
# A delay randomiser function used by the default backoff function.
|
267
|
+
# Some predefined functions can be referenced by name - :none, :equal, :full,
|
268
|
+
# otherwise a Proc that takes and returns a number. This option is only used
|
269
|
+
# in the `legacy` retry mode.
|
270
|
+
#
|
271
|
+
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
272
|
+
#
|
273
|
+
# @option options [Integer] :retry_limit (3)
|
274
|
+
# The maximum number of times to retry failed requests. Only
|
275
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
276
|
+
# are retried. Generally, these are throttling errors, data
|
277
|
+
# checksum errors, networking errors, timeout errors, auth errors,
|
278
|
+
# endpoint discovery, and errors from expired credentials.
|
279
|
+
# This option is only used in the `legacy` retry mode.
|
280
|
+
#
|
281
|
+
# @option options [Integer] :retry_max_delay (0)
|
282
|
+
# The maximum number of seconds to delay between retries (0 for no limit)
|
283
|
+
# used by the default backoff function. This option is only used in the
|
284
|
+
# `legacy` retry mode.
|
285
|
+
#
|
286
|
+
# @option options [String] :retry_mode ("legacy")
|
287
|
+
# Specifies which retry algorithm to use. Values are:
|
288
|
+
#
|
289
|
+
# * `legacy` - The pre-existing retry behavior. This is default value if
|
290
|
+
# no retry mode is provided.
|
291
|
+
#
|
292
|
+
# * `standard` - A standardized set of retry rules across the AWS SDKs.
|
293
|
+
# This includes support for retry quotas, which limit the number of
|
294
|
+
# unsuccessful retries a client can make.
|
295
|
+
#
|
296
|
+
# * `adaptive` - An experimental retry mode that includes all the
|
297
|
+
# functionality of `standard` mode along with automatic client side
|
298
|
+
# throttling. This is a provisional mode that may change behavior
|
299
|
+
# in the future.
|
300
|
+
#
|
301
|
+
#
|
302
|
+
# @option options [String] :sdk_ua_app_id
|
303
|
+
# A unique and opaque application ID that is appended to the
|
304
|
+
# User-Agent header as app/sdk_ua_app_id. It should have a
|
305
|
+
# maximum length of 50. This variable is sourced from environment
|
306
|
+
# variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
|
307
|
+
#
|
308
|
+
# @option options [String] :secret_access_key
|
309
|
+
#
|
310
|
+
# @option options [String] :session_token
|
311
|
+
#
|
312
|
+
# @option options [Boolean] :stub_responses (false)
|
313
|
+
# Causes the client to return stubbed responses. By default
|
314
|
+
# fake responses are generated and returned. You can specify
|
315
|
+
# the response data to return or errors to raise by calling
|
316
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
317
|
+
#
|
318
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
319
|
+
# requests are made, and retries are disabled.
|
320
|
+
#
|
321
|
+
# @option options [Aws::TokenProvider] :token_provider
|
322
|
+
# A Bearer Token Provider. This can be an instance of any one of the
|
323
|
+
# following classes:
|
324
|
+
#
|
325
|
+
# * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
|
326
|
+
# tokens.
|
327
|
+
#
|
328
|
+
# * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
|
329
|
+
# access token generated from `aws login`.
|
330
|
+
#
|
331
|
+
# When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
|
332
|
+
# will be used to search for tokens configured for your profile in shared configuration files.
|
333
|
+
#
|
334
|
+
# @option options [Boolean] :use_dualstack_endpoint
|
335
|
+
# When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
|
336
|
+
# will be used if available.
|
337
|
+
#
|
338
|
+
# @option options [Boolean] :use_fips_endpoint
|
339
|
+
# When set to `true`, fips compatible endpoints will be used if available.
|
340
|
+
# When a `fips` region is used, the region is normalized and this config
|
341
|
+
# is set to `true`.
|
342
|
+
#
|
343
|
+
# @option options [Boolean] :validate_params (true)
|
344
|
+
# When `true`, request parameters are validated before
|
345
|
+
# sending the request.
|
346
|
+
#
|
347
|
+
# @option options [Aws::SSOOIDC::EndpointProvider] :endpoint_provider
|
348
|
+
# The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::SSOOIDC::EndpointParameters`
|
349
|
+
#
|
350
|
+
# @option options [Float] :http_continue_timeout (1)
|
351
|
+
# The number of seconds to wait for a 100-continue response before sending the
|
352
|
+
# request body. This option has no effect unless the request has "Expect"
|
353
|
+
# header set to "100-continue". Defaults to `nil` which disables this
|
354
|
+
# behaviour. This value can safely be set per request on the session.
|
355
|
+
#
|
356
|
+
# @option options [Float] :http_idle_timeout (5)
|
357
|
+
# The number of seconds a connection is allowed to sit idle before it
|
358
|
+
# is considered stale. Stale connections are closed and removed from the
|
359
|
+
# pool before making a request.
|
360
|
+
#
|
361
|
+
# @option options [Float] :http_open_timeout (15)
|
362
|
+
# The default number of seconds to wait for response data.
|
363
|
+
# This value can safely be set per-request on the session.
|
364
|
+
#
|
365
|
+
# @option options [URI::HTTP,String] :http_proxy
|
366
|
+
# A proxy to send requests through. Formatted like 'http://proxy.com:123'.
|
367
|
+
#
|
368
|
+
# @option options [Float] :http_read_timeout (60)
|
369
|
+
# The default number of seconds to wait for response data.
|
370
|
+
# This value can safely be set per-request on the session.
|
371
|
+
#
|
372
|
+
# @option options [Boolean] :http_wire_trace (false)
|
373
|
+
# When `true`, HTTP debug output will be sent to the `:logger`.
|
374
|
+
#
|
375
|
+
# @option options [Proc] :on_chunk_received
|
376
|
+
# When a Proc object is provided, it will be used as callback when each chunk
|
377
|
+
# of the response body is received. It provides three arguments: the chunk,
|
378
|
+
# the number of bytes received, and the total number of
|
379
|
+
# bytes in the response (or nil if the server did not send a `content-length`).
|
380
|
+
#
|
381
|
+
# @option options [Proc] :on_chunk_sent
|
382
|
+
# When a Proc object is provided, it will be used as callback when each chunk
|
383
|
+
# of the request body is sent. It provides three arguments: the chunk,
|
384
|
+
# the number of bytes read from the body, and the total number of
|
385
|
+
# bytes in the body.
|
386
|
+
#
|
387
|
+
# @option options [Boolean] :raise_response_errors (true)
|
388
|
+
# When `true`, response errors are raised.
|
389
|
+
#
|
390
|
+
# @option options [String] :ssl_ca_bundle
|
391
|
+
# Full path to the SSL certificate authority bundle file that should be used when
|
392
|
+
# verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
|
393
|
+
# `:ssl_ca_directory` the the system default will be used if available.
|
394
|
+
#
|
395
|
+
# @option options [String] :ssl_ca_directory
|
396
|
+
# Full path of the directory that contains the unbundled SSL certificate
|
397
|
+
# authority files for verifying peer certificates. If you do
|
398
|
+
# not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
|
399
|
+
# default will be used if available.
|
400
|
+
#
|
401
|
+
# @option options [String] :ssl_ca_store
|
402
|
+
# Sets the X509::Store to verify peer certificate.
|
403
|
+
#
|
404
|
+
# @option options [Float] :ssl_timeout
|
405
|
+
# Sets the SSL timeout in seconds
|
406
|
+
#
|
407
|
+
# @option options [Boolean] :ssl_verify_peer (true)
|
408
|
+
# When `true`, SSL peer certificates are verified when establishing a connection.
|
409
|
+
#
|
410
|
+
def initialize(*args)
|
411
|
+
super
|
412
|
+
end
|
413
|
+
|
414
|
+
# @!group API Operations
|
415
|
+
|
416
|
+
# Creates and returns access and refresh tokens for clients that are
|
417
|
+
# authenticated using client secrets. The access token can be used to
|
418
|
+
# fetch short-term credentials for the assigned AWS accounts or to
|
419
|
+
# access application APIs using `bearer` authentication.
|
420
|
+
#
|
421
|
+
# @option params [required, String] :client_id
|
422
|
+
# The unique identifier string for the client or application. This value
|
423
|
+
# comes from the result of the RegisterClient API.
|
424
|
+
#
|
425
|
+
# @option params [required, String] :client_secret
|
426
|
+
# A secret string generated for the client. This value should come from
|
427
|
+
# the persisted result of the RegisterClient API.
|
428
|
+
#
|
429
|
+
# @option params [required, String] :grant_type
|
430
|
+
# Supports the following OAuth grant types: Device Code and Refresh
|
431
|
+
# Token. Specify either of the following values, depending on the grant
|
432
|
+
# type that you want:
|
433
|
+
#
|
434
|
+
# * Device Code - `urn:ietf:params:oauth:grant-type:device_code`
|
435
|
+
#
|
436
|
+
# * Refresh Token - `refresh_token`
|
437
|
+
#
|
438
|
+
# For information about how to obtain the device code, see the
|
439
|
+
# StartDeviceAuthorization topic.
|
440
|
+
#
|
441
|
+
# @option params [String] :device_code
|
442
|
+
# Used only when calling this API for the Device Code grant type. This
|
443
|
+
# short-term code is used to identify this authorization request. This
|
444
|
+
# comes from the result of the StartDeviceAuthorization API.
|
445
|
+
#
|
446
|
+
# @option params [String] :code
|
447
|
+
# Used only when calling this API for the Authorization Code grant type.
|
448
|
+
# The short-term code is used to identify this authorization request.
|
449
|
+
# This grant type is currently unsupported for the CreateToken API.
|
450
|
+
#
|
451
|
+
# @option params [String] :refresh_token
|
452
|
+
# Used only when calling this API for the Refresh Token grant type. This
|
453
|
+
# token is used to refresh short-term tokens, such as the access token,
|
454
|
+
# that might expire.
|
455
|
+
#
|
456
|
+
# For more information about the features and limitations of the current
|
457
|
+
# IAM Identity Center OIDC implementation, see *Considerations for Using
|
458
|
+
# this Guide* in the [IAM Identity Center OIDC API Reference][1].
|
459
|
+
#
|
460
|
+
#
|
461
|
+
#
|
462
|
+
# [1]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html
|
463
|
+
#
|
464
|
+
# @option params [Array<String>] :scope
|
465
|
+
# The list of scopes for which authorization is requested. The access
|
466
|
+
# token that is issued is limited to the scopes that are granted. If
|
467
|
+
# this value is not specified, IAM Identity Center authorizes all scopes
|
468
|
+
# that are configured for the client during the call to RegisterClient.
|
469
|
+
#
|
470
|
+
# @option params [String] :redirect_uri
|
471
|
+
# Used only when calling this API for the Authorization Code grant type.
|
472
|
+
# This value specifies the location of the client or application that
|
473
|
+
# has registered to receive the authorization code.
|
474
|
+
#
|
475
|
+
# @option params [String] :code_verifier
|
476
|
+
# Used only when calling this API for the Authorization Code grant type.
|
477
|
+
# This value is generated by the client and presented to validate the
|
478
|
+
# original code challenge value the client passed at authorization time.
|
479
|
+
#
|
480
|
+
# @return [Types::CreateTokenResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
481
|
+
#
|
482
|
+
# * {Types::CreateTokenResponse#access_token #access_token} => String
|
483
|
+
# * {Types::CreateTokenResponse#token_type #token_type} => String
|
484
|
+
# * {Types::CreateTokenResponse#expires_in #expires_in} => Integer
|
485
|
+
# * {Types::CreateTokenResponse#refresh_token #refresh_token} => String
|
486
|
+
# * {Types::CreateTokenResponse#id_token #id_token} => String
|
487
|
+
#
|
488
|
+
#
|
489
|
+
# @example Example: Call OAuth/OIDC /token endpoint for Device Code grant with Secret authentication
|
490
|
+
#
|
491
|
+
# resp = client.create_token({
|
492
|
+
# client_id: "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID",
|
493
|
+
# client_secret: "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0",
|
494
|
+
# device_code: "yJraWQiOiJrZXktMTU2Njk2ODA4OCIsImFsZyI6IkhTMzIn0EXAMPLEDEVICECODE",
|
495
|
+
# grant_type: "urn:ietf:params:oauth:grant-type:device-code",
|
496
|
+
# })
|
497
|
+
#
|
498
|
+
# resp.to_h outputs the following:
|
499
|
+
# {
|
500
|
+
# access_token: "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
|
501
|
+
# expires_in: 1579729529,
|
502
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
503
|
+
# token_type: "Bearer",
|
504
|
+
# }
|
505
|
+
#
|
506
|
+
# @example Example: Call OAuth/OIDC /token endpoint for Refresh Token grant with Secret authentication
|
507
|
+
#
|
508
|
+
# resp = client.create_token({
|
509
|
+
# client_id: "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID",
|
510
|
+
# client_secret: "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0",
|
511
|
+
# grant_type: "refresh_token",
|
512
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
513
|
+
# scope: [
|
514
|
+
# "codewhisperer:completions",
|
515
|
+
# ],
|
516
|
+
# })
|
517
|
+
#
|
518
|
+
# resp.to_h outputs the following:
|
519
|
+
# {
|
520
|
+
# access_token: "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
|
521
|
+
# expires_in: 1579729529,
|
522
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
523
|
+
# token_type: "Bearer",
|
524
|
+
# }
|
525
|
+
#
|
526
|
+
# @example Request syntax with placeholder values
|
527
|
+
#
|
528
|
+
# resp = client.create_token({
|
529
|
+
# client_id: "ClientId", # required
|
530
|
+
# client_secret: "ClientSecret", # required
|
531
|
+
# grant_type: "GrantType", # required
|
532
|
+
# device_code: "DeviceCode",
|
533
|
+
# code: "AuthCode",
|
534
|
+
# refresh_token: "RefreshToken",
|
535
|
+
# scope: ["Scope"],
|
536
|
+
# redirect_uri: "URI",
|
537
|
+
# code_verifier: "CodeVerifier",
|
538
|
+
# })
|
539
|
+
#
|
540
|
+
# @example Response structure
|
541
|
+
#
|
542
|
+
# resp.access_token #=> String
|
543
|
+
# resp.token_type #=> String
|
544
|
+
# resp.expires_in #=> Integer
|
545
|
+
# resp.refresh_token #=> String
|
546
|
+
# resp.id_token #=> String
|
547
|
+
#
|
548
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/CreateToken AWS API Documentation
|
549
|
+
#
|
550
|
+
# @overload create_token(params = {})
|
551
|
+
# @param [Hash] params ({})
|
552
|
+
def create_token(params = {}, options = {})
|
553
|
+
req = build_request(:create_token, params)
|
554
|
+
req.send_request(options)
|
555
|
+
end
|
556
|
+
|
557
|
+
# Creates and returns access and refresh tokens for clients and
|
558
|
+
# applications that are authenticated using IAM entities. The access
|
559
|
+
# token can be used to fetch short-term credentials for the assigned
|
560
|
+
# Amazon Web Services accounts or to access application APIs using
|
561
|
+
# `bearer` authentication.
|
562
|
+
#
|
563
|
+
# @option params [required, String] :client_id
|
564
|
+
# The unique identifier string for the client or application. This value
|
565
|
+
# is an application ARN that has OAuth grants configured.
|
566
|
+
#
|
567
|
+
# @option params [required, String] :grant_type
|
568
|
+
# Supports the following OAuth grant types: Authorization Code, Refresh
|
569
|
+
# Token, JWT Bearer, and Token Exchange. Specify one of the following
|
570
|
+
# values, depending on the grant type that you want:
|
571
|
+
#
|
572
|
+
# * Authorization Code - `authorization_code`
|
573
|
+
#
|
574
|
+
# * Refresh Token - `refresh_token`
|
575
|
+
#
|
576
|
+
# * JWT Bearer - `urn:ietf:params:oauth:grant-type:jwt-bearer`
|
577
|
+
#
|
578
|
+
# * Token Exchange - `urn:ietf:params:oauth:grant-type:token-exchange`
|
579
|
+
#
|
580
|
+
# @option params [String] :code
|
581
|
+
# Used only when calling this API for the Authorization Code grant type.
|
582
|
+
# This short-term code is used to identify this authorization request.
|
583
|
+
# The code is obtained through a redirect from IAM Identity Center to a
|
584
|
+
# redirect URI persisted in the Authorization Code GrantOptions for the
|
585
|
+
# application.
|
586
|
+
#
|
587
|
+
# @option params [String] :refresh_token
|
588
|
+
# Used only when calling this API for the Refresh Token grant type. This
|
589
|
+
# token is used to refresh short-term tokens, such as the access token,
|
590
|
+
# that might expire.
|
591
|
+
#
|
592
|
+
# For more information about the features and limitations of the current
|
593
|
+
# IAM Identity Center OIDC implementation, see *Considerations for Using
|
594
|
+
# this Guide* in the [IAM Identity Center OIDC API Reference][1].
|
595
|
+
#
|
596
|
+
#
|
597
|
+
#
|
598
|
+
# [1]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html
|
599
|
+
#
|
600
|
+
# @option params [String] :assertion
|
601
|
+
# Used only when calling this API for the JWT Bearer grant type. This
|
602
|
+
# value specifies the JSON Web Token (JWT) issued by a trusted token
|
603
|
+
# issuer. To authorize a trusted token issuer, configure the JWT Bearer
|
604
|
+
# GrantOptions for the application.
|
605
|
+
#
|
606
|
+
# @option params [Array<String>] :scope
|
607
|
+
# The list of scopes for which authorization is requested. The access
|
608
|
+
# token that is issued is limited to the scopes that are granted. If the
|
609
|
+
# value is not specified, IAM Identity Center authorizes all scopes
|
610
|
+
# configured for the application, including the following default
|
611
|
+
# scopes: `openid`, `aws`, `sts:identity_context`.
|
612
|
+
#
|
613
|
+
# @option params [String] :redirect_uri
|
614
|
+
# Used only when calling this API for the Authorization Code grant type.
|
615
|
+
# This value specifies the location of the client or application that
|
616
|
+
# has registered to receive the authorization code.
|
617
|
+
#
|
618
|
+
# @option params [String] :subject_token
|
619
|
+
# Used only when calling this API for the Token Exchange grant type.
|
620
|
+
# This value specifies the subject of the exchange. The value of the
|
621
|
+
# subject token must be an access token issued by IAM Identity Center to
|
622
|
+
# a different client or application. The access token must have
|
623
|
+
# authorized scopes that indicate the requested application as a target
|
624
|
+
# audience.
|
625
|
+
#
|
626
|
+
# @option params [String] :subject_token_type
|
627
|
+
# Used only when calling this API for the Token Exchange grant type.
|
628
|
+
# This value specifies the type of token that is passed as the subject
|
629
|
+
# of the exchange. The following value is supported:
|
630
|
+
#
|
631
|
+
# * Access Token - `urn:ietf:params:oauth:token-type:access_token`
|
632
|
+
#
|
633
|
+
# @option params [String] :requested_token_type
|
634
|
+
# Used only when calling this API for the Token Exchange grant type.
|
635
|
+
# This value specifies the type of token that the requester can receive.
|
636
|
+
# The following values are supported:
|
637
|
+
#
|
638
|
+
# * Access Token - `urn:ietf:params:oauth:token-type:access_token`
|
639
|
+
#
|
640
|
+
# * Refresh Token - `urn:ietf:params:oauth:token-type:refresh_token`
|
641
|
+
#
|
642
|
+
# @option params [String] :code_verifier
|
643
|
+
# Used only when calling this API for the Authorization Code grant type.
|
644
|
+
# This value is generated by the client and presented to validate the
|
645
|
+
# original code challenge value the client passed at authorization time.
|
646
|
+
#
|
647
|
+
# @return [Types::CreateTokenWithIAMResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
648
|
+
#
|
649
|
+
# * {Types::CreateTokenWithIAMResponse#access_token #access_token} => String
|
650
|
+
# * {Types::CreateTokenWithIAMResponse#token_type #token_type} => String
|
651
|
+
# * {Types::CreateTokenWithIAMResponse#expires_in #expires_in} => Integer
|
652
|
+
# * {Types::CreateTokenWithIAMResponse#refresh_token #refresh_token} => String
|
653
|
+
# * {Types::CreateTokenWithIAMResponse#id_token #id_token} => String
|
654
|
+
# * {Types::CreateTokenWithIAMResponse#issued_token_type #issued_token_type} => String
|
655
|
+
# * {Types::CreateTokenWithIAMResponse#scope #scope} => Array<String>
|
656
|
+
#
|
657
|
+
#
|
658
|
+
# @example Example: Call OAuth/OIDC /token endpoint for Authorization Code grant with IAM authentication
|
659
|
+
#
|
660
|
+
# resp = client.create_token_with_iam({
|
661
|
+
# client_id: "arn:aws:sso::123456789012:application/ssoins-111111111111/apl-222222222222",
|
662
|
+
# code: "yJraWQiOiJrZXktMTU2Njk2ODA4OCIsImFsZyI6IkhTMzg0In0EXAMPLEAUTHCODE",
|
663
|
+
# grant_type: "authorization_code",
|
664
|
+
# redirect_uri: "https://mywebapp.example/redirect",
|
665
|
+
# scope: [
|
666
|
+
# "openid",
|
667
|
+
# "aws",
|
668
|
+
# "sts:identity_context",
|
669
|
+
# ],
|
670
|
+
# })
|
671
|
+
#
|
672
|
+
# resp.to_h outputs the following:
|
673
|
+
# {
|
674
|
+
# access_token: "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
|
675
|
+
# expires_in: 1579729529,
|
676
|
+
# id_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhd3M6aWRlbnRpdHlfc3RvcmVfaWQiOiJkLTMzMzMzMzMzMzMiLCJzdWIiOiI3MzA0NDhmMi1lMGExLTcwYTctYzk1NC0wMDAwMDAwMDAwMDAiLCJhd3M6aW5zdGFuY2VfYWNjb3VudCI6IjExMTExMTExMTExMSIsInN0czppZGVudGl0eV9jb250ZXh0IjoiRVhBTVBMRUlERU5USVRZQ09OVEVYVCIsInN0czphdWRpdF9jb250ZXh0IjoiRVhBTVBMRUFVRElUQ09OVEVYVCIsImlzcyI6Imh0dHBzOi8vaWRlbnRpdHljZW50ZXIuYW1hem9uYXdzLmNvbS9zc29pbnMtMTExMTExMTExMTExIiwiYXdzOmlkZW50aXR5X3N0b3JlX2FybiI6ImFybjphd3M6aWRlbnRpdHlzdG9yZTo6MTExMTExMTExMTExOmlkZW50aXR5c3RvcmUvZC0zMzMzMzMzMzMzIiwiYXVkIjoiYXJuOmF3czpzc286OjEyMzQ1Njc4OTAxMjphcHBsaWNhdGlvbi9zc29pbnMtMTExMTExMTExMTExL2FwbC0yMjIyMjIyMjIyMjIiLCJhd3M6aW5zdGFuY2VfYXJuIjoiYXJuOmF3czpzc286OjppbnN0YW5jZS9zc29pbnMtMTExMTExMTExMTExIiwiYXdzOmNyZWRlbnRpYWxfaWQiOiJfWlIyTjZhVkJqMjdGUEtheWpfcEtwVjc3QVBERl80MXB4ZXRfWWpJdUpONlVJR2RBdkpFWEFNUExFQ1JFRElEIiwiYXV0aF90aW1lIjoiMjAyMC0wMS0yMlQxMjo0NToyOVoiLCJleHAiOjE1Nzk3Mjk1MjksImlhdCI6MTU3OTcyNTkyOX0.Xyah6qbk78qThzJ41iFU2yfGuRqqtKXHrJYwQ8L9Ip0",
|
677
|
+
# issued_token_type: "urn:ietf:params:oauth:token-type:refresh_token",
|
678
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
679
|
+
# scope: [
|
680
|
+
# "openid",
|
681
|
+
# "aws",
|
682
|
+
# "sts:identity_context",
|
683
|
+
# ],
|
684
|
+
# token_type: "Bearer",
|
685
|
+
# }
|
686
|
+
#
|
687
|
+
# @example Example: Call OAuth/OIDC /token endpoint for Refresh Token grant with IAM authentication
|
688
|
+
#
|
689
|
+
# resp = client.create_token_with_iam({
|
690
|
+
# client_id: "arn:aws:sso::123456789012:application/ssoins-111111111111/apl-222222222222",
|
691
|
+
# grant_type: "refresh_token",
|
692
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
693
|
+
# })
|
694
|
+
#
|
695
|
+
# resp.to_h outputs the following:
|
696
|
+
# {
|
697
|
+
# access_token: "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
|
698
|
+
# expires_in: 1579729529,
|
699
|
+
# issued_token_type: "urn:ietf:params:oauth:token-type:refresh_token",
|
700
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
701
|
+
# scope: [
|
702
|
+
# "openid",
|
703
|
+
# "aws",
|
704
|
+
# "sts:identity_context",
|
705
|
+
# ],
|
706
|
+
# token_type: "Bearer",
|
707
|
+
# }
|
708
|
+
#
|
709
|
+
# @example Example: Call OAuth/OIDC /token endpoint for JWT Bearer grant with IAM authentication
|
710
|
+
#
|
711
|
+
# resp = client.create_token_with_iam({
|
712
|
+
# assertion: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjFMVE16YWtpaGlSbGFfOHoyQkVKVlhlV01xbyJ9.eyJ2ZXIiOiIyLjAiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vOTEyMjA0MGQtNmM2Ny00YzViLWIxMTItMzZhMzA0YjY2ZGFkL3YyLjAiLCJzdWIiOiJBQUFBQUFBQUFBQUFBQUFBQUFBQUFJa3pxRlZyU2FTYUZIeTc4MmJidGFRIiwiYXVkIjoiNmNiMDQwMTgtYTNmNS00NmE3LWI5OTUtOTQwYzc4ZjVhZWYzIiwiZXhwIjoxNTM2MzYxNDExLCJpYXQiOjE1MzYyNzQ3MTEsIm5iZiI6MTUzNjI3NDcxMSwibmFtZSI6IkFiZSBMaW5jb2xuIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiQWJlTGlAbWljcm9zb2Z0LmNvbSIsIm9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC02NmYzLTMzMzJlY2E3ZWE4MSIsInRpZCI6IjkxMjIwNDBkLTZjNjctNGM1Yi1iMTEyLTM2YTMwNGI2NmRhZCIsIm5vbmNlIjoiMTIzNTIzIiwiYWlvIjoiRGYyVVZYTDFpeCFsTUNXTVNPSkJjRmF0emNHZnZGR2hqS3Y4cTVnMHg3MzJkUjVNQjVCaXN2R1FPN1lXQnlqZDhpUURMcSFlR2JJRGFreXA1bW5PcmNkcUhlWVNubHRlcFFtUnA2QUlaOGpZIn0.1AFWW-Ck5nROwSlltm7GzZvDwUkqvhSQpm55TQsmVo9Y59cLhRXpvB8n-55HCr9Z6G_31_UbeUkoz612I2j_Sm9FFShSDDjoaLQr54CreGIJvjtmS3EkK9a7SJBbcpL1MpUtlfygow39tFjY7EVNW9plWUvRrTgVk7lYLprvfzw-CIqw3gHC-T7IK_m_xkr08INERBtaecwhTeN4chPC4W3jdmw_lIxzC48YoQ0dB1L9-ImX98Egypfrlbm0IBL5spFzL6JDZIRRJOu8vecJvj1mq-IUhGt0MacxX8jdxYLP-KUu2d9MbNKpCKJuZ7p8gwTL5B7NlUdh_dmSviPWrw",
|
713
|
+
# client_id: "arn:aws:sso::123456789012:application/ssoins-111111111111/apl-222222222222",
|
714
|
+
# grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
|
715
|
+
# })
|
716
|
+
#
|
717
|
+
# resp.to_h outputs the following:
|
718
|
+
# {
|
719
|
+
# access_token: "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
|
720
|
+
# expires_in: 1579729529,
|
721
|
+
# id_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhd3M6aWRlbnRpdHlfc3RvcmVfaWQiOiJkLTMzMzMzMzMzMzMiLCJzdWIiOiI3MzA0NDhmMi1lMGExLTcwYTctYzk1NC0wMDAwMDAwMDAwMDAiLCJhd3M6aW5zdGFuY2VfYWNjb3VudCI6IjExMTExMTExMTExMSIsInN0czppZGVudGl0eV9jb250ZXh0IjoiRVhBTVBMRUlERU5USVRZQ09OVEVYVCIsInN0czphdWRpdF9jb250ZXh0IjoiRVhBTVBMRUFVRElUQ09OVEVYVCIsImlzcyI6Imh0dHBzOi8vaWRlbnRpdHljZW50ZXIuYW1hem9uYXdzLmNvbS9zc29pbnMtMTExMTExMTExMTExIiwiYXdzOmlkZW50aXR5X3N0b3JlX2FybiI6ImFybjphd3M6aWRlbnRpdHlzdG9yZTo6MTExMTExMTExMTExOmlkZW50aXR5c3RvcmUvZC0zMzMzMzMzMzMzIiwiYXVkIjoiYXJuOmF3czpzc286OjEyMzQ1Njc4OTAxMjphcHBsaWNhdGlvbi9zc29pbnMtMTExMTExMTExMTExL2FwbC0yMjIyMjIyMjIyMjIiLCJhd3M6aW5zdGFuY2VfYXJuIjoiYXJuOmF3czpzc286OjppbnN0YW5jZS9zc29pbnMtMTExMTExMTExMTExIiwiYXdzOmNyZWRlbnRpYWxfaWQiOiJfWlIyTjZhVkJqMjdGUEtheWpfcEtwVjc3QVBERl80MXB4ZXRfWWpJdUpONlVJR2RBdkpFWEFNUExFQ1JFRElEIiwiYXV0aF90aW1lIjoiMjAyMC0wMS0yMlQxMjo0NToyOVoiLCJleHAiOjE1Nzk3Mjk1MjksImlhdCI6MTU3OTcyNTkyOX0.Xyah6qbk78qThzJ41iFU2yfGuRqqtKXHrJYwQ8L9Ip0",
|
722
|
+
# issued_token_type: "urn:ietf:params:oauth:token-type:refresh_token",
|
723
|
+
# refresh_token: "aorvJYubGpU6i91YnH7Mfo-AT2fIVa1zCfA_Rvq9yjVKIP3onFmmykuQ7E93y2I-9Nyj-A_sVvMufaLNL0bqnDRtgAkc0:MGUCMFrRsktMRVlWaOR70XGMFGLL0SlcCw4DiYveIiOVx1uK9BbD0gvAddsW3UTLozXKMgIxAJ3qxUvjpnlLIOaaKOoa/FuNgqJVvr9GMwDtnAtlh9iZzAkEXAMPLEREFRESHTOKEN",
|
724
|
+
# scope: [
|
725
|
+
# "openid",
|
726
|
+
# "aws",
|
727
|
+
# "sts:identity_context",
|
728
|
+
# ],
|
729
|
+
# token_type: "Bearer",
|
730
|
+
# }
|
731
|
+
#
|
732
|
+
# @example Example: Call OAuth/OIDC /token endpoint for Token Exchange grant with IAM authentication
|
733
|
+
#
|
734
|
+
# resp = client.create_token_with_iam({
|
735
|
+
# client_id: "arn:aws:sso::123456789012:application/ssoins-111111111111/apl-222222222222",
|
736
|
+
# grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
|
737
|
+
# requested_token_type: "urn:ietf:params:oauth:token-type:access_token",
|
738
|
+
# subject_token: "aoak-Hig8TUDPNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZDIFFERENTACCESSTOKEN",
|
739
|
+
# subject_token_type: "urn:ietf:params:oauth:token-type:access_token",
|
740
|
+
# })
|
741
|
+
#
|
742
|
+
# resp.to_h outputs the following:
|
743
|
+
# {
|
744
|
+
# access_token: "aoal-YigITUDiNX1xZwOMXM5MxOWDL0E0jg9P6_C_jKQPxS_SKCP6f0kh1Up4g7TtvQqkMnD-GJiU_S1gvug6SrggAkc0:MGYCMQD3IatVjV7jAJU91kK3PkS/SfA2wtgWzOgZWDOR7sDGN9t0phCZz5It/aes/3C1Zj0CMQCKWOgRaiz6AIhza3DSXQNMLjRKXC8F8ceCsHlgYLMZ7hZidEXAMPLEACCESSTOKEN",
|
745
|
+
# expires_in: 1579729529,
|
746
|
+
# id_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhd3M6aWRlbnRpdHlfc3RvcmVfaWQiOiJkLTMzMzMzMzMzMzMiLCJzdWIiOiI3MzA0NDhmMi1lMGExLTcwYTctYzk1NC0wMDAwMDAwMDAwMDAiLCJhd3M6aW5zdGFuY2VfYWNjb3VudCI6IjExMTExMTExMTExMSIsInN0czppZGVudGl0eV9jb250ZXh0IjoiRVhBTVBMRUlERU5USVRZQ09OVEVYVCIsImlzcyI6Imh0dHBzOi8vaWRlbnRpdHljZW50ZXIuYW1hem9uYXdzLmNvbS9zc29pbnMtMTExMTExMTExMTExIiwiYXdzOmlkZW50aXR5X3N0b3JlX2FybiI6ImFybjphd3M6aWRlbnRpdHlzdG9yZTo6MTExMTExMTExMTExOmlkZW50aXR5c3RvcmUvZC0zMzMzMzMzMzMzIiwiYXVkIjoiYXJuOmF3czpzc286OjEyMzQ1Njc4OTAxMjphcHBsaWNhdGlvbi9zc29pbnMtMTExMTExMTExMTExL2FwbC0yMjIyMjIyMjIyMjIiLCJhd3M6aW5zdGFuY2VfYXJuIjoiYXJuOmF3czpzc286OjppbnN0YW5jZS9zc29pbnMtMTExMTExMTExMTExIiwiYXdzOmNyZWRlbnRpYWxfaWQiOiJfWlIyTjZhVkJqMjdGUEtheWpfcEtwVjc3QVBERl80MXB4ZXRfWWpJdUpONlVJR2RBdkpFWEFNUExFQ1JFRElEIiwiYXV0aF90aW1lIjoiMjAyMC0wMS0yMlQxMjo0NToyOVoiLCJleHAiOjE1Nzk3Mjk1MjksImlhdCI6MTU3OTcyNTkyOX0.5SYiW1kMsuUr7nna-l5tlakM0GNbMHvIM2_n0QD23jM",
|
747
|
+
# issued_token_type: "urn:ietf:params:oauth:token-type:access_token",
|
748
|
+
# scope: [
|
749
|
+
# "openid",
|
750
|
+
# "aws",
|
751
|
+
# "sts:identity_context",
|
752
|
+
# ],
|
753
|
+
# token_type: "Bearer",
|
754
|
+
# }
|
755
|
+
#
|
756
|
+
# @example Request syntax with placeholder values
|
757
|
+
#
|
758
|
+
# resp = client.create_token_with_iam({
|
759
|
+
# client_id: "ClientId", # required
|
760
|
+
# grant_type: "GrantType", # required
|
761
|
+
# code: "AuthCode",
|
762
|
+
# refresh_token: "RefreshToken",
|
763
|
+
# assertion: "Assertion",
|
764
|
+
# scope: ["Scope"],
|
765
|
+
# redirect_uri: "URI",
|
766
|
+
# subject_token: "SubjectToken",
|
767
|
+
# subject_token_type: "TokenTypeURI",
|
768
|
+
# requested_token_type: "TokenTypeURI",
|
769
|
+
# code_verifier: "CodeVerifier",
|
770
|
+
# })
|
771
|
+
#
|
772
|
+
# @example Response structure
|
773
|
+
#
|
774
|
+
# resp.access_token #=> String
|
775
|
+
# resp.token_type #=> String
|
776
|
+
# resp.expires_in #=> Integer
|
777
|
+
# resp.refresh_token #=> String
|
778
|
+
# resp.id_token #=> String
|
779
|
+
# resp.issued_token_type #=> String
|
780
|
+
# resp.scope #=> Array
|
781
|
+
# resp.scope[0] #=> String
|
782
|
+
#
|
783
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/CreateTokenWithIAM AWS API Documentation
|
784
|
+
#
|
785
|
+
# @overload create_token_with_iam(params = {})
|
786
|
+
# @param [Hash] params ({})
|
787
|
+
def create_token_with_iam(params = {}, options = {})
|
788
|
+
req = build_request(:create_token_with_iam, params)
|
789
|
+
req.send_request(options)
|
790
|
+
end
|
791
|
+
|
792
|
+
# Registers a client with IAM Identity Center. This allows clients to
|
793
|
+
# initiate device authorization. The output should be persisted for
|
794
|
+
# reuse through many authentication requests.
|
795
|
+
#
|
796
|
+
# @option params [required, String] :client_name
|
797
|
+
# The friendly name of the client.
|
798
|
+
#
|
799
|
+
# @option params [required, String] :client_type
|
800
|
+
# The type of client. The service supports only `public` as a client
|
801
|
+
# type. Anything other than public will be rejected by the service.
|
802
|
+
#
|
803
|
+
# @option params [Array<String>] :scopes
|
804
|
+
# The list of scopes that are defined by the client. Upon authorization,
|
805
|
+
# this list is used to restrict permissions when granting an access
|
806
|
+
# token.
|
807
|
+
#
|
808
|
+
# @option params [Array<String>] :redirect_uris
|
809
|
+
# The list of redirect URI that are defined by the client. At completion
|
810
|
+
# of authorization, this list is used to restrict what locations the
|
811
|
+
# user agent can be redirected back to.
|
812
|
+
#
|
813
|
+
# @option params [Array<String>] :grant_types
|
814
|
+
# The list of OAuth 2.0 grant types that are defined by the client. This
|
815
|
+
# list is used to restrict the token granting flows available to the
|
816
|
+
# client.
|
817
|
+
#
|
818
|
+
# @option params [String] :issuer_url
|
819
|
+
# The IAM Identity Center Issuer URL associated with an instance of IAM
|
820
|
+
# Identity Center. This value is needed for user access to resources
|
821
|
+
# through the client.
|
822
|
+
#
|
823
|
+
# @option params [String] :entitled_application_arn
|
824
|
+
# This IAM Identity Center application ARN is used to define
|
825
|
+
# administrator-managed configuration for public client access to
|
826
|
+
# resources. At authorization, the scopes, grants, and redirect URI
|
827
|
+
# available to this client will be restricted by this application
|
828
|
+
# resource.
|
829
|
+
#
|
830
|
+
# @return [Types::RegisterClientResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
831
|
+
#
|
832
|
+
# * {Types::RegisterClientResponse#client_id #client_id} => String
|
833
|
+
# * {Types::RegisterClientResponse#client_secret #client_secret} => String
|
834
|
+
# * {Types::RegisterClientResponse#client_id_issued_at #client_id_issued_at} => Integer
|
835
|
+
# * {Types::RegisterClientResponse#client_secret_expires_at #client_secret_expires_at} => Integer
|
836
|
+
# * {Types::RegisterClientResponse#authorization_endpoint #authorization_endpoint} => String
|
837
|
+
# * {Types::RegisterClientResponse#token_endpoint #token_endpoint} => String
|
838
|
+
#
|
839
|
+
#
|
840
|
+
# @example Example: Call OAuth/OIDC /register-client endpoint
|
841
|
+
#
|
842
|
+
# resp = client.register_client({
|
843
|
+
# client_name: "My IDE Plugin",
|
844
|
+
# client_type: "public",
|
845
|
+
# entitled_application_arn: "arn:aws:sso::ACCOUNTID:application/ssoins-1111111111111111/apl-1111111111111111",
|
846
|
+
# grant_types: [
|
847
|
+
# "authorization_code",
|
848
|
+
# "refresh_token",
|
849
|
+
# ],
|
850
|
+
# issuer_url: "https://identitycenter.amazonaws.com/ssoins-1111111111111111",
|
851
|
+
# redirect_uris: [
|
852
|
+
# "127.0.0.1:PORT/oauth/callback",
|
853
|
+
# ],
|
854
|
+
# scopes: [
|
855
|
+
# "sso:account:access",
|
856
|
+
# "codewhisperer:completions",
|
857
|
+
# ],
|
858
|
+
# })
|
859
|
+
#
|
860
|
+
# resp.to_h outputs the following:
|
861
|
+
# {
|
862
|
+
# client_id: "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID",
|
863
|
+
# client_id_issued_at: 1579725929,
|
864
|
+
# client_secret: "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0",
|
865
|
+
# client_secret_expires_at: 1587584729,
|
866
|
+
# }
|
867
|
+
#
|
868
|
+
# @example Request syntax with placeholder values
|
869
|
+
#
|
870
|
+
# resp = client.register_client({
|
871
|
+
# client_name: "ClientName", # required
|
872
|
+
# client_type: "ClientType", # required
|
873
|
+
# scopes: ["Scope"],
|
874
|
+
# redirect_uris: ["URI"],
|
875
|
+
# grant_types: ["GrantType"],
|
876
|
+
# issuer_url: "URI",
|
877
|
+
# entitled_application_arn: "ArnType",
|
878
|
+
# })
|
879
|
+
#
|
880
|
+
# @example Response structure
|
881
|
+
#
|
882
|
+
# resp.client_id #=> String
|
883
|
+
# resp.client_secret #=> String
|
884
|
+
# resp.client_id_issued_at #=> Integer
|
885
|
+
# resp.client_secret_expires_at #=> Integer
|
886
|
+
# resp.authorization_endpoint #=> String
|
887
|
+
# resp.token_endpoint #=> String
|
888
|
+
#
|
889
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/RegisterClient AWS API Documentation
|
890
|
+
#
|
891
|
+
# @overload register_client(params = {})
|
892
|
+
# @param [Hash] params ({})
|
893
|
+
def register_client(params = {}, options = {})
|
894
|
+
req = build_request(:register_client, params)
|
895
|
+
req.send_request(options)
|
896
|
+
end
|
897
|
+
|
898
|
+
# Initiates device authorization by requesting a pair of verification
|
899
|
+
# codes from the authorization service.
|
900
|
+
#
|
901
|
+
# @option params [required, String] :client_id
|
902
|
+
# The unique identifier string for the client that is registered with
|
903
|
+
# IAM Identity Center. This value should come from the persisted result
|
904
|
+
# of the RegisterClient API operation.
|
905
|
+
#
|
906
|
+
# @option params [required, String] :client_secret
|
907
|
+
# A secret string that is generated for the client. This value should
|
908
|
+
# come from the persisted result of the RegisterClient API operation.
|
909
|
+
#
|
910
|
+
# @option params [required, String] :start_url
|
911
|
+
# The URL for the Amazon Web Services access portal. For more
|
912
|
+
# information, see [Using the Amazon Web Services access portal][1] in
|
913
|
+
# the *IAM Identity Center User Guide*.
|
914
|
+
#
|
915
|
+
#
|
916
|
+
#
|
917
|
+
# [1]: https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html
|
918
|
+
#
|
919
|
+
# @return [Types::StartDeviceAuthorizationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
920
|
+
#
|
921
|
+
# * {Types::StartDeviceAuthorizationResponse#device_code #device_code} => String
|
922
|
+
# * {Types::StartDeviceAuthorizationResponse#user_code #user_code} => String
|
923
|
+
# * {Types::StartDeviceAuthorizationResponse#verification_uri #verification_uri} => String
|
924
|
+
# * {Types::StartDeviceAuthorizationResponse#verification_uri_complete #verification_uri_complete} => String
|
925
|
+
# * {Types::StartDeviceAuthorizationResponse#expires_in #expires_in} => Integer
|
926
|
+
# * {Types::StartDeviceAuthorizationResponse#interval #interval} => Integer
|
927
|
+
#
|
928
|
+
#
|
929
|
+
# @example Example: Call OAuth/OIDC /start-device-authorization endpoint
|
930
|
+
#
|
931
|
+
# resp = client.start_device_authorization({
|
932
|
+
# client_id: "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID",
|
933
|
+
# client_secret: "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0",
|
934
|
+
# start_url: "https://identitycenter.amazonaws.com/ssoins-111111111111",
|
935
|
+
# })
|
936
|
+
#
|
937
|
+
# resp.to_h outputs the following:
|
938
|
+
# {
|
939
|
+
# device_code: "yJraWQiOiJrZXktMTU2Njk2ODA4OCIsImFsZyI6IkhTMzIn0EXAMPLEDEVICECODE",
|
940
|
+
# expires_in: 1579729529,
|
941
|
+
# interval: 1,
|
942
|
+
# user_code: "makdfsk83yJraWQiOiJrZXktMTU2Njk2sImFsZyI6IkhTMzIn0EXAMPLEUSERCODE",
|
943
|
+
# verification_uri: "https://device.sso.us-west-2.amazonaws.com",
|
944
|
+
# verification_uri_complete: "https://device.sso.us-west-2.amazonaws.com?user_code=makdfsk83yJraWQiOiJrZXktMTU2Njk2sImFsZyI6IkhTMzIn0EXAMPLEUSERCODE",
|
945
|
+
# }
|
946
|
+
#
|
947
|
+
# @example Request syntax with placeholder values
|
948
|
+
#
|
949
|
+
# resp = client.start_device_authorization({
|
950
|
+
# client_id: "ClientId", # required
|
951
|
+
# client_secret: "ClientSecret", # required
|
952
|
+
# start_url: "URI", # required
|
953
|
+
# })
|
954
|
+
#
|
955
|
+
# @example Response structure
|
956
|
+
#
|
957
|
+
# resp.device_code #=> String
|
958
|
+
# resp.user_code #=> String
|
959
|
+
# resp.verification_uri #=> String
|
960
|
+
# resp.verification_uri_complete #=> String
|
961
|
+
# resp.expires_in #=> Integer
|
962
|
+
# resp.interval #=> Integer
|
963
|
+
#
|
964
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/StartDeviceAuthorization AWS API Documentation
|
965
|
+
#
|
966
|
+
# @overload start_device_authorization(params = {})
|
967
|
+
# @param [Hash] params ({})
|
968
|
+
def start_device_authorization(params = {}, options = {})
|
969
|
+
req = build_request(:start_device_authorization, params)
|
970
|
+
req.send_request(options)
|
971
|
+
end
|
972
|
+
|
973
|
+
# @!endgroup
|
974
|
+
|
975
|
+
# @param params ({})
|
976
|
+
# @api private
|
977
|
+
def build_request(operation_name, params = {})
|
978
|
+
handlers = @handlers.for(operation_name)
|
979
|
+
context = Seahorse::Client::RequestContext.new(
|
980
|
+
operation_name: operation_name,
|
981
|
+
operation: config.api.operation(operation_name),
|
982
|
+
client: self,
|
983
|
+
params: params,
|
984
|
+
config: config)
|
985
|
+
context[:gem_name] = 'aws-sdk-core'
|
986
|
+
context[:gem_version] = '3.197.2'
|
987
|
+
Seahorse::Client::Request.new(handlers, context)
|
988
|
+
end
|
989
|
+
|
990
|
+
# @api private
|
991
|
+
# @deprecated
|
992
|
+
def waiter_names
|
993
|
+
[]
|
994
|
+
end
|
995
|
+
|
996
|
+
class << self
|
997
|
+
|
998
|
+
# @api private
|
999
|
+
attr_reader :identifier
|
1000
|
+
|
1001
|
+
# @api private
|
1002
|
+
def errors_module
|
1003
|
+
Errors
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
end
|
1007
|
+
end
|
1008
|
+
end
|