AgoraIO-Extensions / Agora-Flutter-SDK

Flutter plugin of Agora RTC SDK for Android/iOS/macOS/Windows

Home Page:https://pub.dev/packages/agora_rtc_engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: invalid token, authorized failed

EritonSoares opened this issue · comments

Goodnight,

I have a problem with the iris-web-rtc_n423_w4182_0.3.0.js SDK.

When I generate the token through golang and place it in my project, it returns the error "Agora-SDK [WARNING]: data: {"desc":"invalid token, authorized failed","retry":false,"csIp":"184.72. 16.87"}
AgoraRTCException: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: invalid token, authorized failed
at http://localhost:64257/iris-web-rtc_n423_w4182_0.3.0.js:2:18849
at Array.forEach ()
at tI (http://localhost:64257/iris-web-rtc_n423_w4182_0.3.0.js:2:18425)
at e.gatewayInfo.wA.joinChooseServer.lts (http://localhost:64257/iris-web-rtc_n423_w4182_0.3.0.js:2:16844)
at async http://localhost:64257/iris-web-rtc_n423_w4182_0.3.0.js:1:125906".

However, when I generate the token via https://console.agora.io/token it works. And the funniest thing is that in one project I use the token generated by https://console.agora.io/token and in the other I use the token generated by golang to close the communication.

What can I be doing to make iris-web-rtc recognize the golang token?

It's a little tricky that you should use different ways to generate the token on the web, I think you can reference this doc https://docs.agora.io/en/video-calling/reference/manage-agora-account?platform=web

If you need help, I think you'd better raise a new ticket to Agora Support for this issue.

I'm actually not having any problems generating the token. I already have a functional project in version 5.3.1 (for web) where generating the token using golang (which, by the way, I used the agora.io manual to assemble) works perfectly.

It is only in this new version 6.2.6 that the token generated by golang is not being recognized.

I managed to find the problem. The uid variable was wrong and did not validate the token.

Thank you very much for your attention.

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.