AgoraIO / API-Examples-Web

224 stars 199 forks source link

CAN_NOT_GET_GATEWAY_SERVER: dynamic use static key #82

Closed neilyoung closed 8 months ago

neilyoung commented 8 months ago

Got some credentials from a colleague, trusted them :)

Create Client. OK Join Channel brings this:

AgoraRTC_N.js:5 15:54:58:287 Agora-SDK [ERROR]: [client-be997] join number: 1, Joining channel failed, rollback AgoraRTCException: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: flag: 4096, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic use static key
    at cA (https://download.agora.io/sdk/release/AgoraRTC_N.js:6:19351)
    at e.gatewayInfo.rI.joinChooseServer.lts (https://download.agora.io/sdk/release/AgoraRTC_N.js:6:16937)
    at async https://download.agora.io/sdk/release/AgoraRTC_N.js:5:139507

index.js:63 AgoraRTCException: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: flag: 4096, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic use static key
    at cA (https://download.agora.io/sdk/release/AgoraRTC_N.js:6:19351)
    at e.gatewayInfo.rI.joinChooseServer.lts (https://download.agora.io/sdk/release/AgoraRTC_N.js:6:16937)
    at async https://download.agora.io/sdk/release/AgoraRTC_N.js:5:139507
plutoless commented 8 months ago

please read the docs to understand how to sign tokens when you join channel. you are trying to use appid only to join a channel for projects which has token on.

neilyoung commented 8 months ago

yepp, I have that token too, but where to provide that?

neilyoung commented 8 months ago

I believe he forgot to provide me the certificate...

plutoless commented 8 months ago

if you are talking about this demo, you will need the project appid, app certificate and configure them in left menu top item.

plutoless commented 8 months ago

you are right.

neilyoung commented 8 months ago

OK, thanks. Got that working. Found, that I had an own account with you. Took the settings from there - works.

Thanks

neilyoung commented 8 months ago

On additional question, if allowed: In order to subscribe to my own publication I need to provide a UserID. But for some reasons I'm not able to enter a userID for the publisher. The cursor weirdly jumps back to the beginning in the edit field. Any idea?

neilyoung commented 8 months ago

Here a video showing the behaviour:

https://www.youtube.com/watch?v=nuE5k60gJv8

neilyoung commented 8 months ago

OK, another issue here, but the reason for the jumpy behaviour of the userID input field is this regexp:

          <div>
              <input class="form-control" id="uid" class="form-control" type="text"
                onkeyup="this.value=this.value.replace(/[^0-9]/g,'')"
                onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')" placeholder="Enter the user ID">
            </div>

Removed it all and now I can enter something. Wondering, should only effect numbers at the first glance, but I didn't enter numbers...

neilyoung commented 8 months ago

But looks like I don't need that userId at all (for the moment)

plutoless commented 8 months ago

uid is required to be numbers. if you don't enter it, a random one will be used.

neilyoung commented 8 months ago

I'm opening a new issue. The regexp is behaving nuts.

neilyoung commented 8 months ago

Oh, yes, shame on me... Sorry.