Tools
Tools copied to clipboard
NO_AUTHORIZED
Hi, i did the integration using laravel framework, when i created the temp token in your dashboard it worked correctly, but when i used the php code to generate token always i receive no authorized, next is the php code to generate the token
` $appID = $settings['agora_app_id']; $appCertificate = $settings['agora_app_certificate']; $channelName = Request::get('channelName'); //$uid = auth()->user()->id; $uidStr = '' . auth()->user()->id; $role = RtcTokenBuilder::RoleAttendee;
$minutes_to_add = 3;
$privilegeExpiredTs = (new \DateTime("now", new \DateTimeZone(config('app.timezone'))))
->add(new DateInterval('PT' . $minutes_to_add . 'M'))
->getTimestamp();
$token = RtcTokenBuilder::buildTokenWithUserAccount($appID, $appCertificate, $channelName, $uidStr, $role, $privilegeExpiredTs);
` i need your help please
@abdosaeedelhassan First, run https://github.com/AgoraIO/Tools/blob/master/DynamicKey/AgoraDynamicKey/php/sample/RtcTokenBuilder2Sample.php to get the token. Then, use https://webdemo.agora.io/agora-web-showcase/examples/Agora-Web-Tutorial-1to1-Web/ to verify if the token is valid.