create_one_time_deep_link_code
¶
create_one_time_deep_link_code(
domain_id: DomainId,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
ttl_seconds: Optional[int] = None,
redirect_url: Optional[str] = None,
) -> CreateOneTimeDeepLinkCodeOutput
Generates a one-time code for deep-link authentication. Direct the user's browser to the returned deepLinkUrl before it expires. The code is exchanged for an authenticated, domain-scoped session and can be used only once.
Parameters:
-
domain_id(DomainId) –The ID of the domain to generate the code for.
-
ttl_seconds(Optional[int], default:None) –How long the code remains valid, in seconds. Defaults to 300.
-
redirect_url(Optional[str], default:None) –The URL to redirect to after the deep-link code is used. Must be an HTTPS URL in the domain with a path of /auth/callback, and cannot include a query string or fragment. If omitted, no redirect is applied.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ResourceNotFoundException–The specified resource does not exist.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create a one-time deep-link code The following example creates a one-time deep-link code for a domain that remains valid for 300 seconds and, once used, redirects the browser to the domain's /auth/callback path. Direct the user's browser to the returned deepLinkUrl before it expires; the code can be used only once. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.create_one_time_deep_link_code(domain_id='d-1a2b3c4d5e', ttl_seconds=300, redirect_url='https://d-1a2b3c4d5e.cloudwatch-omni.global.app.aws/auth/callback')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 | |