getAccessToken method
Gets a temporary access token to use with AssumeRoleWithWebIdentity. Access tokens are valid for one hour.
May throw ValidationException. May throw AuthorizationException. May throw AccessDeniedException. May throw RateLimitExceededException. May throw ServerInternalException.
Parameter token
:
Refresh token, encoded as a JWT token.
Parameter tokenProperties
:
Token properties to validate against those present in the JWT token.
Implementation
Future<GetAccessTokenResponse> getAccessToken({
required String token,
List<String>? tokenProperties,
}) async {
ArgumentError.checkNotNull(token, 'token');
_s.validateStringLength(
'token',
token,
0,
4096,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSLicenseManager.GetAccessToken'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Token': token,
if (tokenProperties != null) 'TokenProperties': tokenProperties,
},
);
return GetAccessTokenResponse.fromJson(jsonResponse.body);
}