{
"message": "Failed to identify user for token: 2133064859c8b07be8e5e6395381f7f0 deploymentId: afead3f5-70e7-4730-ae2e-1b70a9e46f0a",
"code": "unauthorized",
"status": 401,
"contextId": "0b288ade-454f-46b6-8581-35ecef3876fb",
"details": [],
"errors": []
}
So this API is used to exchange authCode for token for authenticated messaging. I use this request in mobile WebView component with redirect url scheme "spotnana://". This redirect URL is accepted by my IDP, since the redirect URL successfully return the auth code. Can genesys take this redirectUri without issue? I couldn't find out what is wrong with my request.
Regarding the redirect uri, I would say it's not an issue for the authentication phase.
The process "just" checks that what you provided is what is configured.
There is no "usage" of the redirect uri itself as such.
Based on the contextId you provided, I could see in logs a response from the authentication server with an "invalid_grant" error.
I don't have more details. But this means that the exchange request reached your server that rejected it.
Can you check authentication server logs to find out why the request was rejected ?
I would suggest to test manually the exchange request itself from a browser.
To do so, open the discovery document you set up in the integration.
Find the token endpoint and invoke it using the parameters you set up.
POST /token
Content-Type: application/x-www-form-urlencoded
authorization: Basic base64(<clientId>:<secret>)
grant_type=authorization_code&redirect_uri=<redirect_uri>&code=<exchange_code>
Thanks a lot V.P.!
Right now I don't have access to IDP log. Can you help me get successful log and the failure log at Genesys side? I'd like to compare them to find some clue.
Here are the AWS log of the Genesys cloud request to IDP. The working one is from web. The not working one is from WebView component in React Native. Do you see anything wrong?
We are properly sending back the redirect_uri as reported in the not-working.json file.
The log file does not really give a reason for the rejection.
We are receiving on our side an 'invalid_grant' error code.
I think that you should open a case with AWS by providing the requestId of the failed test and ask why Cognito is rejecting the token exchange when setting an app uri.