create_one_time_deep_link_code
async
¶
create_one_time_deep_link_code(
domain_id: DomainId,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = 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.
>>> await 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/async_cloud_watch_omni.py
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | |