The errors you are reporting are not specific to SDK but rather backend errors.
1- First error is HTTP 403. It means that the token you provided has expired.
You need either to refresh it or generate a new one.
2- The second error tells you that the token you provided is valid (so authentication succeeded), but the referenced user (in this token) does not match the one previously registered for the current Webmessaging session.
Once a user is authenticated with a session, link is established and cannot be broken.
You need to start a new session if you want to use this token.
3- Third case is an un-successful authentication error (HTTP 401). No token is generated. Something went wrong.
There is a troubleshooting errors section available at the service level. Let us know if you think it lacks details.
It applies to all clients/SDKs.
In fact, the above errors all occur after SDK jwt exchange, and even restarting the authenticated session cannot solve the error. Is there any way to remedy this error in mobile? thanks
1- This means that you authenticated with a different user (different from the one used previously).
The token contains a unique userId (sub claim in OpenID) set by the authorization server.
If the userId is different, it will fail.
2- Yes, that's a way of doing it.
return below error
{
"type": "response",
"class": "string",
"code": 400,
"body": "Impossible to update authenticatedCustomerId"
}
try to call clearConversation but still this issue
How can I retry to resolve this error?
As previously stated, you're using a different user than the previous registered one.
Are you using always the same user ?
1/ If not, then this is the expected behavior. You cannot change users in an authenticated session.
2/ If yes, here's what you can do:
Authenticate with a given user by calling api/v2/webdeployments/token/oauthcodegrantjwtexchange
copy the JWT sent back and decode it with (using jwt.io site).
Write down the sub attribute (see picture).
Authenticate again with the same user.
copy the JWT sent back and decode it.
Write down the sub attribute.
Compare both values. They must be identical.
If they are not, then this means that the authorization is not consistent and does not send back a unique Id for the same user. This could happen (for example) with mock servers used for testing that send back random ids.
For a given user, it is expected to have always the same sub value.