Tools icon indicating copy to clipboard operation
Tools copied to clipboard

Error 110 Token Generate C#

Open diegabo1996 opened this issue 4 years ago • 4 comments

Hi!

I was trying to test the token creator but when i generate a token with this it doesn't work, please help!

private string _appId = "xxxxxxxxxxxxx"; private string _appCertificate = "xxxxxxxxxxx"; private string _channelName = "123456789"; private string _uid = "7894561230"; private uint _ts = (uint)DateTimeOffset.Now.ToUnixTimeSeconds(); private uint _salt = 1; private uint _expiredTs = 1611537276;

    [Fact]
    public void testGenerateDynamicKey()
    {
        _expiredTs = _ts + 10000;

        AccessToken token = new AccessToken(_appId, _appCertificate, _channelName, _uid);

        token.addPrivilege(Privileges.kJoinChannel, _expiredTs);
        string result = token.build();
       // Assert.Equal(expected, result);
    }

diegabo1996 avatar Jan 24 '21 03:01 diegabo1996

could you pls provide a token you generated?

plutoless avatar Jan 25 '21 17:01 plutoless

I generated Token using c# for RTC and RTM. For RTM, its working perfectly fine but for RTC i am getting the error. The token is "006cd972ece20434a42a3c1ddeea9e479e1IAAE6aAi7OSWBttPaNC/MgBCEcXK5gGrAb1+Ns6LCLNW034WEjqlc6GMEAAKJ52HogrXYAEAAgASx9Vg"

image

sherazakbar50 avatar Jun 25 '21 11:06 sherazakbar50

Same for me as well. Do we need to authenticate the given user from the agora? Is there any API available to authenticate users? Throughout Agora is a big failure for providing documentation for developers.

Nithinjith avatar Aug 03 '21 05:08 Nithinjith

Same for me here. I cannot generate a valid token using the c# package. So far no one is able to help me yet on the ticket https://github.com/AgoraIO/Tools/issues/131

Hoang-Minh avatar Nov 16 '21 18:11 Hoang-Minh

Change _appId and _appCertificate to the account information you applied for, run the UT of this file https://github.com/AgoraIO/Tools/blob/master/DynamicKey/AgoraDynamicKey/csharp/test/AgoraIO.Tests/RtcTokenBuilderTest.cs. Test the generated token on this website https://webdemo.agora.io/agora-web-showcase/examples/Agora-Web-Tutorial-1to1-Web/

sunshinexcode avatar Jul 18 '24 12:07 sunshinexcode