getAuthenticationUrl method

Future<GetAuthenticationUrlResponse> getAuthenticationUrl({
  1. required String connectionToken,
  2. required String redirectUri,
  3. required String sessionId,
})

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.
The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication.

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);
}