getAuthenticationUrl method
Retrieves the AuthenticationUrl for the current authentication session for the AuthenticateCustomer flow block.
For security recommendations, see Connect Customer Chat security best practices.
- This API can only be called within one minute of receiving the authenticationInitiated event.
- The current supported channel is chat. This API is not supported for Apple Messages for Business, WhatsApp, or SMS chats.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter connectionToken :
The authentication token associated with the participant's connection.
Parameter redirectUri :
The URL where the customer will be redirected after Amazon Cognito
authorizes the user.
Parameter sessionId :
The sessionId provided in the authenticationInitiated event.
Implementation
Future<GetAuthenticationUrlResponse> getAuthenticationUrl({
required String connectionToken,
required String redirectUri,
required String sessionId,
}) async {
final headers = <String, String>{
'X-Amz-Bearer': connectionToken.toString(),
};
final $payload = <String, dynamic>{
'RedirectUri': redirectUri,
'SessionId': sessionId,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/participant/authentication-url',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetAuthenticationUrlResponse.fromJson(response);
}