Tools icon indicating copy to clipboard operation
Tools copied to clipboard

Client keeps disconnecting from Agora Chat server after opening connection with token and username

Open Chris-CWZ opened this issue 3 years ago • 3 comments

I have successfully generated a User Token on my backend and passed it to client. Client uses Agora Username and said User Token to open connection with Agora Chat Server. After connection, it returns a ChatToken(access_token which I dont even know what its supposed to be used for). But after a few seconds, it disconnects from the server. This happens every single time and causes me to be unable to send any messages since it says User not login(error code 39)

Chris-CWZ avatar Nov 17 '22 15:11 Chris-CWZ

It is recommended to check the expired time of the token

sunshinexcode avatar Nov 22 '22 01:11 sunshinexcode

It seems to be an issue with token expire setting. @Chris-CWZ Maybe you can set a long expire time from your backend, You can refer to this setting https://github.com/AgoraIO/Agora-Chat-API-Examples/blob/main/chat-app-server/src/main/resources/application.properties

Mr-Dead-Rabbit avatar Nov 22 '22 03:11 Mr-Dead-Rabbit

Thanks for the feedback, I've already set the expiry time to be 86400 seconds as per the documentation, but the issue is still there. I've reported this issue via a ticket on the Agora platform, and they've escalated this issue to Tier 2. Seems like a bug on their end, and they're fixing it

Chris-CWZ avatar Nov 22 '22 04:11 Chris-CWZ