Giter Site home page Giter Site logo

Invalid Token about tools HOT 6 CLOSED

agoraio avatar agoraio commented on August 15, 2024
Invalid Token

from tools.

Comments (6)

plutoless avatar plutoless commented on August 15, 2024 2

if you specify uid when you calculate a token. the token can only be used by corresponding user.
if you want to provide a token which works for any user joining this channel, provide uid 0 when calculating a token - although this is causing some security concerns.

from tools.

plutoless avatar plutoless commented on August 15, 2024 1

i think you can leave 24 * 3600 as it is. A token will be invalid after 24 hours by default. In most cases you don't need to care about this parameter.
if you want to set 30 minutes for expiredTs, set it to currentTimeStamp + 30 * 60

from tools.

plutoless avatar plutoless commented on August 15, 2024

@georgemichailou could you pls try using the access token version? as dynamic key4 is a bit out dated.

from tools.

georgemichailou avatar georgemichailou commented on August 15, 2024

Thanks @plutoless , the access token is working perfect !!

Can i ask you something ?

I cant understand the values for _ts and _expiredTs.

[1]: The timestamp, represented by the number of seconds elapsed since 1/1/1970. The user can use the Dynamic Key to access the Agora service within 5 minutes after the Dynamic Key is generated. If the user does not access the Agora service after 5 minutes, the Dynamic Key is no longer valid.

[2]: Set the value to 0 for no time limit. Indicates the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When the value is set for Call Expiration Timestamp, it does not mean that the Dynamic Key will be expired, but means that the user will be kicked out of the channel.

For the _ts the default value is

uint _ts = (uint)(Utils.Utils.getTimestamp() + 24 * 3600);

What is the 24 * 3600 ?

For the _expiredTs if i want to set 30 minutes expiration what can i do ? The 0 value is for no time limit.

This one is not a good practise ?

uint _ts = (uint)(Utils.Utils.getTimestamp()); // the number of seconds elapsed since 1/1/1970
uint _expiredTs = (uint)(Utils.Utils.getTimestamp() + 30*60); //30 minutes expiration

Thanks.

from tools.

georgemichailou avatar georgemichailou commented on August 15, 2024

One more question @plutoless . If I want to create an one to one communication. Can i use the same token on both sides or i will create the new one on every user ? (with same channel id)

from tools.

jb-7-jay avatar jb-7-jay commented on August 15, 2024

if you are manually testing this scenario then you must add the same uid at the client-side while joining the room which is there while generating the token.

from tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.