RTM Token Invalid, 401 Unauthorized during Agora Classroom Sdk Launch - PHP
Hello , I have been trying to launch Agora Classroom SDK using an RTM Token I generated for a specific uuid on my PHP Server but always get a 401 unauthorized response, I used the PHP code on this repository and its able to generate the token without problems, however when i pass the rtm token with the appropriate uuid to the launch function, i get a 401 unauthorized response with the message "Invalid Token". I know the uuid i pass to the launch function is the appropriate one because i have debugged and confirmed uuid used for generating the token is same as what i pass to the launch function. I have cross checked my agora app certificate and app id and its correct. However, i am not sure if this has to do with mode of the app which is Testing. Some help will be appreciated, thanks. Below is a sample response i got.
{"method":"GET","headers":{"Content-Type":"application/json","x-agora-token":"006da89c9a077d84e208222c841f88c8aa7IACq6s5Z2axVIgWQpzhUVpxJQ+X5yi69flTUGDk+v04F+0/9qdK42Rt2EABccQEASilUYQEA6APS3lJh","x-agora-uid":"bc060b75-80b4-4b68-9ab9-67c273f2dbc9"}} response: {"message":"invalid token","__status":401}
hi, You can first verify whether the token is valid through https://webdemo.agora.io/agora-web-showcase/examples/Agora-RTM-Tutorial-Web/
I have the same problem. If I find a solution, I would post it here.
@nyelnizy I had the problem that the userAccount was an id of type integer. This must be given as a string in the build function.