Agora-C_Sharp-SDK icon indicating copy to clipboard operation
Agora-C_Sharp-SDK copied to clipboard

Error dynamic use static key

Open imtiazwazir opened this issue 2 years ago • 16 comments

Getting following error

Uncaught (in promise) AgoraRTCException: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: flag: 4096, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic use static key

I did use new key but no effect.

imtiazwazir avatar Jun 19 '22 06:06 imtiazwazir

seems you are using websdk? did you calculate your token when joining channel?

plutoless avatar Jun 22 '22 01:06 plutoless

@imtiazwazir Have you been able to resolve this? I am experiencing thesame error

Highbee4u avatar Jul 12 '22 18:07 Highbee4u

@imtiazwazir @Highbee4u could you pls share the code how you join channel? this error means you should use a dynamic generated token to join channel while you use a static one.

plutoless avatar Jul 13 '22 01:07 plutoless

@imtiazwazir @Highbee4u could you pls share the code how you join channel? this error means you should use a dynamic generated token to join channel while you use a static one.

I am using there PHP class here (https://github.com/AgoraIO/Tools/tree/master/DynamicKey/AgoraDynamicKey/php/sample) and It generate token but the token but couldn't authenticate as it shows this error

Highbee4u avatar Jul 13 '22 08:07 Highbee4u

@Highbee4u the error basically indicates you are not using token at all. it does not even mean the token you generated is incorrect. could you pls share the code how you join channel?

plutoless avatar Jul 13 '22 09:07 plutoless

@Highbee4u the error basically indicates you are not using token at all. it does not even mean the token you generated is incorrect. could you pls share the code how you join channel?

I am not the one responsible for that, I am only to generate token for Fontend people, but he most likely be using the sample code on the Agora Doc

Highbee4u avatar Jul 13 '22 09:07 Highbee4u

then maybe your front-end people didn't take the token as join channel parameter. Maybe try asking him?

plutoless avatar Jul 13 '22 09:07 plutoless

then maybe your front-end people didn't take the token as join channel parameter. Maybe try asking him?

ice_screenshot_20220713-113803

this is what he sent

Highbee4u avatar Jul 13 '22 10:07 Highbee4u

the first parameter of join should be the token you generated for him, instead of static APP_ID

plutoless avatar Jul 13 '22 11:07 plutoless

the first parameter of join should be the token you generated for him, instead of static APP_ID

After changing the first parameter ice_screenshot_20220713-164017

this the response he got

Highbee4u avatar Jul 13 '22 16:07 Highbee4u

this means the token you generated is incorrect. how did you generate your token?

plutoless avatar Jul 14 '22 01:07 plutoless

this means the token you generated is incorrect. how did you generate your token?

I have been able to resolved it, I modified the php class and also changes the time parameter. Thanks

Highbee4u avatar Jul 15 '22 15:07 Highbee4u

How did you solve the issue, please share that with me. I noticed that you are doing it from Dennis's video on youtube, because it's similar to my code

TIkTok593 avatar Feb 03 '23 17:02 TIkTok593

When I got this error it was because my API key and app id was null because I did not set up my environment variables right. I hope this helps someone.

coderFeedForwardAlg avatar Apr 15 '23 14:04 coderFeedForwardAlg

Hi! For me the solution was to set the fourth argument of the client.join function to be the same as the one used to generate the token. Leaving it null will throw that error eg. await this.client.join("appID", "chanel", "token", "uid");

Hope this helps.

CristianTriscu avatar Apr 26 '23 19:04 CristianTriscu

@plutoless eu peguei o token do certificado primario porém pra mim ainda continua o mesmo erro que do colega

tsantos-dev avatar Jun 22 '23 21:06 tsantos-dev