Authenticated Chat

Hi Team,

We are working on Authenticated Chat and followed on the implementation steps provided in https://developer.genesys.cloud/api/digital/webchat/authenticated-chat.

We have the following queries :

Got to know we need to configure API endpoint URL in "Authentication URL" in Widget section.
Ex. https://IP Address:8443/AuthenticatedWebChat/authServlet. Is this url is ok?

How to pass the signed jwt token in create chat script. Pls share the script format.

Any help is highly appreciated.

Regards,
Manju

Hello,

As I am not sure to which widget version you are referring to, please note that Authenticated Web Chat is only supported with Widgets version 1.0 and Widgets version 1.1.
Authenticated Chat is not supported with Widgets v2.
See Widget feature comparison.

With the example in the Authenticated Chat page, which shows the use of Widgets v1.0, the token you get from your servlet would replace the YOUR_SESSION_IDENTIFIER_HERE
The line -> const headers = { Client-Token: 'YOUR_SESSION_IDENTIFIER_HERE' };

You don't need to configure a link to your authServlet. The example assumes that you have made a request from your web page/server before invoking/initializing the widget.

Regards,

Hi Jerome,

We are using Widget version 1.1

JWT/token can be sent using the API directly or the widget provided by PureCloud.

Using the API it should be sent via the memberAuthToken property when starting the chat.
Using the widget it should be sent via the headers containing a Client-Token property.

We are using API and need pass via memberAuthToken.

Enclosed is the snapshot where it's mentioned that API endpoint URL in "Authentication URL" in Widget section in Genesys Cloud needs to be configured

Hello,

If you are using the API (Guest Chat API), I don't think that the Authentication URL (in the Widgets configuration - in Admin/Contact Center/Widgets) matters.

The Authentication URL, which is declared in Admin/Contact Center/Widgets) is meant for the built-in Widgets v1.0/v.1 UI.
It would indeed be the url of the service you have developed to get the token (authServlet).
When you use the Widgets v1.1 UI and you invoke the authenticateGuest (as shown in the example), the provided/built-in widgets in fact retrieves the Authentication URL from the config and issues a request to this URL automatically. The Authenticated Chat page leverages the Widgets v1.0/v.1.1 built-in/provided UI.

If you use the Guest Chat API, then you manage this part yourself (making a request to your auth servlet).
Then, when the jwt token is returned to the web client, you have to send it as part of the Create Chat request.
If I remember properly, the body would be like this:

{
  "organizationId": "4aac8701-19df-40d7-8b4e-7f24bfb0089a",
  "deploymentId" : "0bc87921-d935-44f1-a2cb-29827e35966f",
  "routingTarget" : {
    "targetType" : "queue",
    "targetAddress": "Marketing"
  },
  "memberAuthToken" : "the jwt token obtained via your auth service",
  "memberInfo" : { 
    "displayName" : "Joe Dirt",
    "avatarImageUrl": "http://some-url.com/JoeDirtsFace",
    "lastName" : "Joe"
    "firstName" : "Dirt"
    "email" : "joe.dirt@example.com"
    "phoneNumber" : "+12223334444"
    "customFields" : {
      "some_field" : "arbitrary data",
      "another_field" : "more arbitrary data"
    }
  }
}

Regards,

Hello,

Thanks for the script snippet, authenticated chat worked.

We need one more help on the below query.

The signed JWT token will be having customer data. How can we retrieve customer data from the signed JWT token in Genesys Cloud Architect flow?

Regards,
Manju

Hello,

The data from the signeddata request will be added to the conversation context as participant attributes.
Note that you can check what has been attached using a GET /api/v2/conversations/{conversationId}

I just did a quick test and if you pass an attribute with keyname "mySignedData1" (as an example) in the signeddata request, it will be added to the conversation context as "context.verified:mySignedData1".

You can then retrieve the value in your Architect flow using a "Get Participant Data" block, using context.verified:mySignedData1 as the Attribute Name.
This blog shows a screenshot of the Get Participant Data (but this was for the regular collected chat attributes). With the signed data, just set the attribute name to context.verified:mySignedData1 (i.e. context.verified:the_attribute_name_you_use_in_the_signeddata_request).

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.