Authenticated Messaging Re-Requesting Token Exchange for Code

Hi!

I am implementing an authenticated web chat using the APIs at https://developer.genesys.cloud/commdigital/digital/webmessaging/authenticate

The problem comes when the code is provided via the oauthcodegrantjwtexchange endpoint, passed to the token exchange endpoint, and we generate access and ID tokens in response to this code.

In our case, once the tokens are sent, the Genesys client seems to make the same request over again by providing the same (just-used) authorization code. In this second response we provide a 401 as the code has already been exchanged. That leads to the error response below.

Is there something about the currently-provided access / ID token that is not being accepted?

{"message":"Failed to identify user for token: 104358ad9be03c9fba28c388649805d7 deploymentId: 0326ba24-e4c4-4834-8ac9-b397d66d3d43","code":"unauthorized","status":401,"contextId":"84de6580-ac3e-48dc-b44a-5e47435fd2cb","details":[],"errors":[]}

at: Tue, 30 May 2023 19:08:03 GMT

This was immediately after a successful token exchange / authenticated chat setup for the same user which completed at 2023-05-30T19:07:23.131.

Thanks!

--Coby

Hi Coby,

By looking at the request you mentioned, I could see that the very first request timed-out.
On timeout, there is an automatic retry. It is likely that the authorization server received the code and took some time to respond.
If you have some warm-up phase in your system, it could be an issue indeed.
I have increased the timeout (max 4s vs 2s).
Let me know if that solves the issue.
If not, give a shout.

Regards,
V.P.

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