create_token
async
¶
create_token(
license_arn: Arn,
client_token: ClientToken,
*,
config_overrides: Optional[AsyncLicenseManagerClientConfig] = None,
role_arns: Optional[ArnList] = None,
expiration_in_days: Optional[Integer] = None,
token_properties: Optional[MaxSize3StringList] = None,
) -> CreateTokenResponse
Creates a long-lived token.
A refresh token is a JWT token used to get an access token. With an access token, you can call AssumeRoleWithWebIdentity to get role credentials that you can use to call License Manager to manage the specified license.
Parameters:
-
license_arn(Arn) –Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim of the JWT token.
-
role_arns(Optional[ArnList], default:None) –Amazon Resource Name (ARN) of the IAM roles to embed in the token. License Manager does not check whether the roles are in use.
-
expiration_in_days(Optional[Integer], default:None) –Token expiration, in days, counted from token creation. The default is 365 days.
-
token_properties(Optional[MaxSize3StringList], default:None) –Data specified by the caller to be included in the JWT token. The data is mapped to the amr claim of the JWT token.
-
client_token(ClientToken) –Idempotency token, valid for 10 minutes.
Raises:
-
AccessDeniedException–Access to resource denied.
-
AuthorizationException–The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy associated with this account.
-
RateLimitExceededException–Too many requests have been submitted. Try again after a brief wait.
-
RedirectException–This is not the correct Region for the resource. Try again.
-
ResourceLimitExceededException–Your resource limits have been exceeded.
-
ResourceNotFoundException–The resource cannot be found.
-
ServerInternalException–The server experienced an internal error. Try again.
-
ValidationException–The provided input is not valid. Try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_license_manager/_services/async_license_manager.py
1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 | |