createTrustedTokenIssuer method
Creates a connection to a trusted token issuer in an instance of IAM Identity Center. A trusted token issuer enables trusted identity propagation to be used with applications that authenticate outside of Amazon Web Services.
This trusted token issuer describes an external identity provider (IdP) that can generate claims or assertions in the form of access tokens for a user. Applications enabled for IAM Identity Center can use these tokens for authentication.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter instanceArn :
Specifies the ARN of the instance of IAM Identity Center to contain the
new trusted token issuer configuration.
Parameter name :
Specifies the name of the new trusted token issuer configuration.
Parameter trustedTokenIssuerConfiguration :
Specifies settings that apply to the new trusted token issuer
configuration. The settings that are available depend on what
TrustedTokenIssuerType you specify.
Parameter trustedTokenIssuerType :
Specifies the type of the new trusted token issuer.
Parameter clientToken :
Specifies a unique, case-sensitive ID that you provide to ensure the
idempotency of the request. This lets you safely retry the request without
accidentally performing the same operation a second time. Passing the same
value to a later call to an operation requires that you also pass the same
value for all other parameters. We recommend that you use a UUID type
of value..
If you don't provide this value, then Amazon Web Services generates a random one for you.
If you retry the operation with the same ClientToken, but
with different parameters, the retry fails with an
IdempotentParameterMismatch error.
Parameter tags :
Specifies tags to be attached to the new trusted token issuer
configuration.
Implementation
Future<CreateTrustedTokenIssuerResponse> createTrustedTokenIssuer({
required String instanceArn,
required String name,
required TrustedTokenIssuerConfiguration trustedTokenIssuerConfiguration,
required TrustedTokenIssuerType trustedTokenIssuerType,
String? clientToken,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SWBExternalService.CreateTrustedTokenIssuer'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InstanceArn': instanceArn,
'Name': name,
'TrustedTokenIssuerConfiguration': trustedTokenIssuerConfiguration,
'TrustedTokenIssuerType': trustedTokenIssuerType.value,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'Tags': tags,
},
);
return CreateTrustedTokenIssuerResponse.fromJson(jsonResponse.body);
}