Web Agora.io DYNAMIC_KEY_EXPIRED

点点圈 提交于 2020-06-29 03:34:41

问题


I am using c# with mvc.

I used this code to generate token and generated successfully. but after generate token when join channel using .join() it return DYNAMIC_KEY_EXPIRED. I Used "AgoraRTCSDK-3.1.0.js"

I used https://github.com/AgoraIO/Tools/blob/master/DynamicKey/AgoraDynamicKey/csharp to generate dynamic token

If any one has experience on Agora.io, please help me.

Sample code is..

AccessToken token = new AccessToken(apiKey, appCertificate, channelName, "0");
token.addPrivilege(Privileges.kJoinChannel, _expiredTs);
token.addPrivilege(Privileges.kPublishAudioStream, _expiredTs);
token.addPrivilege(Privileges.kPublishVideoStream, _expiredTs);
string strToken = token.build();

public string build()
    {
        this._messageRawContent = Utils.pack(this.message);
        this._signature = generateSignature(_appCertificate
                , _appId
                , _channelName
                , _uid
                , _messageRawContent);

        this._crcChannelName = Crc32CAlgorithm.Compute(this._channelName.GetByteArray());
        this._crcUid = Crc32CAlgorithm.Compute(this._uid.GetByteArray());

        PackContent packContent = new PackContent(_signature, _crcChannelName, _crcUid, this._messageRawContent);
        byte[] content = Utils.pack(packContent);
        return getVersion() + this._appId + Utils.base64Encode(content);
    }

来源:https://stackoverflow.com/questions/62572240/web-agora-io-dynamic-key-expired

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!