Tools icon indicating copy to clipboard operation
Tools copied to clipboard

Getting: Get server node failed [NO_AUTHORIZED] when tried to use a token created from Server [PHP]

Open niraj-lal-rahi opened this issue 5 years ago • 3 comments

$appID = APP_ID $appCertificate =CERTIFICATE_KEY; $channelName = "test"; $uid = uniqid(); $uidStr = "$uid"; $role = RtcTokenBuilder::RolePublisher; $expireTimeInSeconds = 3600; $currentTimestamp = (new DateTime("now", new DateTimeZone('GMT+5:30')))->getTimestamp(); $privilegeExpiredTs = $currentTimestamp + $expireTimeInSeconds; $token = RtcTokenBuilder::buildTokenWithUid($appID, $appCertificate, $channelName, $uid, $role, $privilegeExpiredTs);

I don't know what is wrong in token generated dynamic, does not allow to broadcast : Join failed: NO_AUTHORIZED.

If I only change $token variable to static temp token then it worked.

Console mode is testing : Certificate is enabled.

generated_token = "006f605e69e63244441a70236c910865104IACFCvNqL1ODQuA2Lmf6Ig8KmXsT630UaZYLHTjVNbhRNvadZ7nomGXdIgBw0AAA3SoSYAQAAQBt5xBgAwBt5xBgAgBt5xBgBABt5xBg"

Thanks

niraj-lal-rahi avatar Jan 27 '21 03:01 niraj-lal-rahi

what is your uid and channel name used when generating the token?

plutoless avatar Jan 31 '21 02:01 plutoless

Hi...

What do you mean by "If I only change $token variable to static temp " please?

Thanks

itscvenk avatar Nov 08 '22 16:11 itscvenk

You can test with the following tools https://github.com/AgoraIO/Tools/tree/master/DynamicKey/AgoraDynamicKey image

sunshinexcode avatar Nov 15 '22 03:11 sunshinexcode