Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login failed with args #1

Open
aeq-dev opened this issue Nov 20, 2021 · 1 comment
Open

Login failed with args #1

aeq-dev opened this issue Nov 20, 2021 · 1 comment

Comments

@aeq-dev
Copy link

aeq-dev commented Nov 20, 2021

Hello,
Thank you for your great tutorials,
I tried to apply this tutorial but I get this error :
The vendor enabled the dynamic key, but uses the static key. +0ms
Error Code 5: login failed with args: {"uid":"User name"}. +14ms

Here is how I'm generating the token :

public function getAgoraTokenRTM($userName)
   {
       $rtm = new RtmTokenBuilder();
       $role = $rtm::RoleRtmUser;
       $expireTimeInSeconds = 3600;
       $currentTimestamp = (new DateTime("now", new DateTimeZone('UTC')))->getTimestamp();
       $privilegeExpiredTs = $currentTimestamp + $expireTimeInSeconds;
       return $rtm::buildToken(env('AGORA_APP_ID'), env('AGORA_CERTIFICATE_ID'), $userName, $role, $privilegeExpiredTs);
   }

Please could you tell me what's the mistake ?
Also, I want to setup this tutorial for only audio (same as twitter space) , no need video, so could you please guide me how to achieve it.
Thank you

@akshatvg
Copy link
Owner

You'll need to create a separate dynamic token for both RTC and RTM and pass them in the application separately. This error happens because of incorrect tokens being passed to the frontend.


I have written another tutorial explaining how you could Build Your Own Group Voice Calling Application Using the Agora Web SDK. This is a simple voice call application.

You could use the above sample app and just add the RTM messaging like I did in the "Invite User to Stage" repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants